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:

  • Record your DISPLAY variable in the interactive node terminal window, you'll need to set it to the same value on the compute node:
    • echo $DISPLAY
  • Start interactive PBS session, e.g.:
    • qsub -I -l nodes=1,walltime=2:00:00
  • Set the DISPLAY variable on the interactive node to the value you get in step 2:
    • setenv DISPLAY marchingmen1:xx.0
  • Run Matlab
    • /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.

    Last Modified: October 06, 2008 @ 21:07:47