CHPC Software: Matlab
Matlab Release 14 SP3 including
Toolbox Bundle (Matlab Compiler, Control Systems, Image Processing,
Optimization, Signal Processing, Simulink, Symbolic Math and System
Identification) installed on all Arches clusters in
/uufs/chpc.utah.edu/sys/pkg/matlab/std.
To run Matlab, first load its environment by including this source
line to your .tcshrc:
source /uufs/chpc.utah.edu/sys/pkg/matlab/std/etc/matlab.csh
or to your .bashrc:
source /uufs/chpc.utah.edu/sys/pkg/matlab/std/etc/matlab.sh
Re-login and run as matlab.
Although Matlab will run on the interactive nodes, please, take note that we don't allow running executables longer than ca. 15 minutes on the interactive nodes due to the load they put on them and inconvenience to other users. For that reason, we recommend to run Matlab through interactive PBS session. To do this, follow these steps:
DISPLAY variable in the
interactive node terminal window, you'll need to set
it to the same value on the compute node:
echo $DISPLAY
qsub -I -l nodes=1,walltime=2:00:00
setenv DISPLAY marchingmen1:xx.0
/uufs/chpc.utah.edu/sys/pkg/matlab/std/bin/matlab
The above method has one serious limitation - it requires interactive session on the compute nodes, which can sometime be difficult to obtain quickly due to the load on the cluster. Therefore, we recommend users to consider compiling their Matlab programs using the Matlab Compiler and run them as a standalone executable. This way one can use non-interactive PBS script to launch the program.
Compiling Matlab program is fairly simple. First make sure that all your
Matlab programs are functions, not scripts. Function is a code that starts
with function statement. Suppose we have functions
main.m, f1.m and f2.m. main.m
is the main function. To compile these three into an executable, do:
mcc -m main f1 f2. This will produce executable named
main, which can then be run via batch on the compute nodes.
There are some limitations in the compilation.
For this and other details, consult the
Matlab Compiler help page.

