Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Helium currently offers Matlab  for use on the clusterMatlab is currently available for use centrally. One may use the Matlab environment by loading the appropriate module: 

[user@helumuser@hpc:~]$ module load matlab_R2012b 

...

Simple Matlab batch job: mat-test.sh

 
#!/bin/bash
# The name of the job:
#$ -N MatlabTest
# Name of the output log file:
#$ -o matjob.log
# Combining output/error messages into one file:
#$ -j y
# Specifying the Queue
#$ -q UI
# One needs to tell the queue system to use the current directory as the working directory
#$ -cwd
# The command(s) to be executed:
matlab -nodisplay -nodesktop -nojvm -r batch
# Note after -r is the name of the routine or function
exit 0

 

...

The current installation of Matlab on Helium uses the Parallel Toolbox, which allows for parallel jobs that can use up to 12 cores per job.  Information on the Parallel Toolkit may be found here: http://www.mathworks.com/help/distcomp/index.html.  

The following example script can be used to submit a Matlab job to Helium SGE to run on 8 cores (you may use all the cores in a node – which may be more than 8). Note that lines starting with '#$'  are SGE shell commands, whereas '#' symbols denote comments , and the remaining lines are matlab commands. 

...

Example Parallel Job: parallel-test.sh

 
#!/bin/bash
# The name of the job:
#$ -N test        ## replace 'test' with job name
# Name of the output log file:
#$ -o matlabTest_parfor.log
# Combining output/error messages into one file ( change y to n for separate files)
#$ -j y
# Specify the parallel environment (PE) and number of cores to use (8):
#$ -pe smp 8
# One needs to tell the queue system to use the current directory as the working directory
#$ -cwd
# The matlab commands to be executed; replace "test" with your function name. 
# -r imediately runs a function without presenting an interactive prompt
/opt/matlab/R2012b/bin/matlab -nodisplay -nodesktop -nosplash -r parafor-test
exit 0

 

...