MATLAB Distributed Compute Engine

This guide covers configuring MATLAB to use the Distributed Compute Engine (DCE) on the cluster.

Access MATLAB

Via Open OnDemand or terminal:

module load matlab/r2019a
matlab

Configuration (MATLAB 2019a)

Step 1: Access Cluster Management

Navigate to EnvironmentParallelCreate and Manage Clusters…

Step 2: Add Cluster Profile

Select Add Cluster Profile and choose Slurm as the scheduler type.

Step 3: Handle Warning

A software access warning appears—click OK to proceed.

Step 4: Configure Settings

Edit the generated profile (typically “SlurmProfile1”):

Setting

Value

Description

Custom name (e.g., “Central Cluster”)

NumWorkers

Desired core count

SubmitArguments

Wallclock time (e.g., -t 24:00:00)

Warning

Recommendation: Use 64 cores or fewer unless requirements demand higher. Larger values increase wait time and costs.

Step 5: Validate

Click the Validate tab to test by submitting test jobs.

If validation fails, copy the report and submit a support ticket.

Configuration (MATLAB R2020+)

Newer versions lack “Additional Slurm Properties.” Add parameters via:

Scheduler PluginAdditionalProperties

Name

Value

Type

AdditionalSubmitArgs

--time=12:00:00 --nodes=1

String

Tip

The --nodes=1 parameter encourages core consolidation on single nodes, improving performance.

Using the Parallel Pool

In your MATLAB code:

% Start parallel pool with cluster profile
parpool('Central Cluster', 32);

% Use parfor for parallel loops
parfor i = 1:1000
    result(i) = expensive_computation(i);
end

% Clean up
delete(gcp('nocreate'));