NERSCPowering Scientific Discovery Since 1974

MATLAB on Cori

Running MATLAB jobs on Cori

Running jobs on Cori is similar to running jobs on Edison. The key differences are:

  • Cori Phase 1 has 32 cores per node, compared to 24 on Edison
  • Cori Phase 1 has 128 GB of memory per node, compared to 64 GB on Edison

Interactive jobs

The following example shows how to run MATLAB interactively

salloc -p regular -N 1 -c 32 -t 30:00
module load matlab
srun -n 1 -c 32 matlab

And how to prepare a MATLAB cluster with 32 cores

cluster = parcluster('local')
cluster.NumWorkers = 32
pp = parpool('cori_cluster', 32)

Cluster compatibility mode CCM

MATLAB is also available under the Cluster Compatibility Mode (CCM). Follow the CCM link for more information.

Batch jobs

To run matlab non-intearctively through a batch job, you can use the following job script:

#!/bin/bash -l
#SBATCH -p regular
#SBATCH -c 32
#SBATCH -t 00:30:00
cd $SLURM_SUBMIT_DIR   # optional, since this is the default behavior
module load matlab
srun -n 1 -c 32 matlab -nodisplay -r myjob -logfile myjob.log

Where myjob.m is your matlab script.