Caltech Home > Caltech HPC Homepage > Documentation > FAQ > Setting up Matlab to use the Distributed Compute Engine
Search open search form

Setting up Matlab to use the Distributed Compute Engine

To use the distributed compute engine in Matlab, it is easiest to open the GUI from within Open OnDemand.  You may find out more about using Open OnDemand here.

If you  open the desktop, open a terminal within the desktop, load the Matlab 2019a module, then launch matlab:

module load matlab/r2019a

You can also use the Matlab application from within on demand if you prefer.  Make sure to specify Matlab 2019a if you do.

Once Matlab is opened up, click on "Environment", Then on "Parallel", and choose "Create and Manage Clusters..."

Matlan DCE environment menu

From the next menu, click "Add Cluster Profile" and select "Slurm"

Matlab DCE select Slurm

Once you select this, you will get a warning message about having access to the software.  Click "OK".  You can also check the "Do not show this message again" checkbox if you like.

Matlab DCE software warning

This will create a new profile.  Typically it is called "SlurmProfile1" but could be something else if you have tried this before.  If you would like, you can double click on the name and rename it to something more appropriate.

Click on the "Edit" Button in the window to be able to edit the cluster.

The most important fields to fill out are the Description, Numworkers, and SubmitArguements.

Description is just a descriptive name for the configuration.  I use "Central Cluster"

NumWorkers is the number of cores you want to be able to use on the cluster from matlab.  The maximum is 512, but it is almost always a better option to choose something smaller like 64 unless you job really requires it. More cores will mean a longer wait time and a higher cost for the run typically.

SubmitArguements is needed to set the wallclock time which is required by the scheduler.  For a 24 hour runtime, type "-t 24:00:00" into the box.  The longest you can run on the cluster for a typical job is 7 days.

Configuring Matlab DCE cluster

Click "Done" when you have finished that, then click on the "Validate" Tab.

The validation will run through the configuration submitting short jobs and making sure it works as expected. If you experience a failure on this validation you may copy the Report output and submit a ticket to the Help system. 

Validating Configuration