Skip to content

Running multiple MATLAB cluster pools as a single user

Gabriel A. Devenyi edited this page Mar 23, 2016 · 1 revision

MATLAB's "local" cluster support on Linux doesn't consider that the same user can login on multiple machines and run multiple cluster jobs.

As a result it will clobber an existing cluster pool when a new one starts unless you give each job a new location for it's temporary files.

All MATLAB cluster jobs should start like this:

> number_of_cores=12;
> d=tempname(); %get a temporary location;
> mkdir(d);
> cluster = parallel.cluster.Local('JobStorageLocation',d,'NumWorkers',number_of_cores);
> matlabpool(cluster,number_of_cores);

12 is the maximum for number_of_cores but this can be any value from 2-12. Make sure when submitting the job to the cluster, you also set -pe smp $number_of_cores to match, so that the cluster gives enough CPUs for matlab.

Clone this wiki locally