MATLAB
MATLAB is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages.
Installed on: blacklight.
PSC has a limited number of MATLAB licenses. If you wish to use MATLAB, you must contact User Services to be given access.
Usage
Please note: Blacklight has both frontend nodes (which you log in to) and compute nodes. The frontend nodes can be used to prepare jobs, but must not be used to run them as that can seriously degrade system performance.
You MUST use the qsub command to run MATLAB jobs. Jobs submitted with qsub run on blacklight's compute nodes.
The instructions that follow show how to run a batch job on blacklight. You can run an interactive job by using qsub -I. See the blacklight document for more information.
To run MATLAB in a batch job:
- Prepare the input files.
At the top of the main -m file, include
maxNumCompThreads(ncpus)
where ncpus is the number of cores requested in the job script.
- Prepare a job script containing commands to:
- Set up the module command
- Load the MATLAB module. First, check to
see what versions are available
module avail matlab
and then load the one you want
module load matlab
This command loads the default version.
- Run MATLAB using -nojvm and -nodisplay.
Use the -nojvm and the -nodisplay options to MATLAB. The nojvm option prevents MATLAB from using its internal Java Virtual Machine. The JVM can spawn a large number of threads and cause the job to fail with a "thread count exceeded" error.
In addition, because MATLAB is not running interactively, you should use nodisplay so that MATLAB does not attempt to start the MATLAB desktop.
To run MATLAB, use a command like:
matlab -nojvm -nodisplay < input-file >& output-file
- Submit the job script with a qsub command.
See the example job.