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 -q interactive -N 1 -c 32 -C haswell -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)

Batch jobs

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

#!/bin/bash -l
#SBATCH -q regular
#SBATCH -c 32
#SBATCH -C haswell #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.