Child pages
  • Hyak MATLAB programming
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

For interactive use of matlab:

ssh -X

qsub -I -V -l walltime=3:00:00

Below command shows you the available matlab versions on hyak:

module avail

Use below command to load matlab and start the GUI

module load matlab_2015b


After the above step, you can continue with your matlab commands at the matlab command line.

For PBS queue use of matlab:

Include below lines in your PBS script. (Do not use -nojvm option of matlab. The -nojvm option prevents usage of parpool for matlab parallel computing.) Here the file name of the matab script is myfunction.m.

module load matlab_2015b
matlab -nosplash -nodisplay -r myfunction

Matlab toolboxes on hyak:

Obtain an interactive node as shown above. Then type below commnds to get a matlab prompt.
module load matlab_2015b
matlab -nosplash -nodisplay
At the matlab prompt enter below command to find the list of toolboxes:


We have a large number of toolboxes. Here are some popular toolboxes:

Image Processing Toolbox

Optimization Toolbox

Parallel Computing Toolbox

Signal Processing Toolbox

Statistics and Machine Learning Toolbox

Matlab parallel programming on hyak:

For interactive use:

At the matlab prompt enter below command to start the parallel pool

>> parpool

Now you can use parfor etc.

For scripting:

The file trypar.m contains below code:

parfor i=1:1000000


You can run trypar.m in parallel at the prompt of an hyak interactive node:

module load matlab_2015b
matlab -nodisplay -nosplash -r trypar


You can run trypar.m in parallel using below PBS script trypar.pbs. Here xyz is the name of your group, abc is your userid, mydir is the directory which contains trypar.m and trypar.pbs.

#PBS -N "trypar"
#PBS -d /gscratch/xyz/abc/mydir
#PBS -l nodes=1:ppn=16,mem=40gb,feature=16core,walltime=06:00:00
#PBS -m abe

module load matlab_2015b
matlab -nodisplay -nosplash -r trypar


Matlab Code Performance:

Matlab Memory Usage:

Matlab Java Memory Usage:


  • No labels