matlab

Note

SCARF is migrating to the SLURM batch system, instructions on this page which refer to LSF commands, parameters or configuration do not apply to SLURM. Please see our SLURM page for more information.

RHEL7 Modules:

MATLAB/2019b.lua
MATLAB/2021a.lua
matlab/9.3
matlab/9.3-unlicensed

Description for matlab:

“The MATLAB Compiler Runtime (MCR) is a standalone set of shared libraries that enables the execution of compiled MATLAB applications or components on computers that do not have MATLAB installed.” from Mathworks website.

“MATLAB® is a high-level language and interactive environment for numerical computation, visualization, and programming.” from Mathworks website.

Using matlab MCR:

MCR stands for Matlab Compiler Runtime is a set of standalone libraries that enables you to run Matlab compiled code without having the need to Matlab.

To use Matlab MCR on SCARF, please make sure that you have already compiled your code using Matlab Compiler. To run the code you can use the following jobscript:

#!/bin/bash
#BSUB -n 4
#BSUB -o %J.o
#BSUB -e %J.e
#BSUB -x

module load matlab/mcr/8.2
./YourCompiledMatlabCode

Running Matlab

Matlab is run on the command line using an LSF job submission script Eg :

#!/bin/bash
#BSUB -n 4
#BSUB -o %J.o
#BSUB -e %J.e
#BSUB -x

module load matlab/R2013b/8.2
matlab -r matlabcode.m

Submit using:

[me@scarf]$ bsub < jcl

Where jcl is the name of the job submission script file from above. When changing the number of processors to run on, be sure to change ‘bsub -n’ as well as ‘mpirun.lsf -np’

To monitor your jobs progress use the normal LSF batch commands eg:

[me@scarf]$ bjobs

or

[me@scarf]$ bjobs -l

You can also run Matlab GUI by first following instructions available here and then by simply running matlab binary:

$ matlab

If you want to run commandline version (without GUI) run:

$ matlab -nodisplay

Documentation for matlab:

http://www.mathworks.co.uk/help/matlab/

http://www.mathworks.co.uk/help/compiler/working-with-the-mcr.html