Personal tools


From UABgrid Documentation

Revision as of 16:12, 10 March 2010 by (Talk | contribs)

Jump to: navigation, search


Steps to run Matlab

Simple Matlab Test

These instructions NOT use the distributed licenses available on cheaha and will be restricted to a single cpu. See the next section for an example using the distributed computing license.

Set up your environment with the command:

module load mathworks/matlab

As a test, you can run MatLab and access your license server with

matlab -c port@license-server -nodesktop -nojvm -r "rand, exit"

For example:

module load mathworks/matlab
matlab -c -nodesktop -nojvm -r "rand, exit"

                        < M A T L A B (R) >
                Copyright 1984-2009 The MathWorks, Inc.
              Version (R2009b) 64-bit (glnxa64)
                          August 12, 2009
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit

ans =


This will start matlab without a graphical display and without Java support. This is good just to verify things work, but do not run any significant computations on the Cheaha head node.

MatLab computational work needs to be run on the compute nodes by submitting a job submission script to the SGE scheduler

You can create a simple single cpu SGE script with (script name "matlabtest.qsub"):

#$ -S /bin/bash
#$ -cwd
#$ -N testMatLab
#$ -l h_rt=00:10:00,s_rt=00:08:00
#$ -j y
#$ -m eas
module load mathworks/matlab
#$ -V
matlab -c port@license-server -nodisplay -nojvm < matlab-script

Then submit the script to the scheduler with

qsub matlabtest.qsub

Check on it with qstat.

qstat -u $USER