MATLAB

Overview

Oakland University has obtained a campus wide license (CWL) for MATLAB. This permits any user to run MATLAB on Matilda without special permission or license files. This page describes some of the ways in which MATLAB can be run on the cluster.

Initial Cluster Configuration

In order to use parallel work and batch modes it is necessary to import cluster configuration settings into your MATLAB profile the first time you run it.

Please use the following:

module load MATLAB
matlab -nodisplay
>>configCluster

Note that if you run the "configCluster" MATLAB command more than once, it will erase and regenerate your cluster profile information, so it is only necessary to do this once.

Interactively Scheduled

A scheduled interactive job can be run on one of the cluster nodes using something like the following:

srun -N 1 -c 1 -t 30:00 --pty /bin/bash --login

Once the session has started, simply load MATLAB and launch the application:

module load MATLAB
matlab -nodisplay

Please see our documentation for more information on scheduling interactive jobs.

Interactive Parallel

You can start an interactive MATLAB job and specify the total number of parallel workers to use during your run. This can be accomplished using something like the following:

module load MATLAB
matlab -nodisplay
>>c=parcluster;
>>p=c.parpool(40)

The command sequence above provides a handle to the cluster resource (parcluster), and then allocates 40 workers (parpool). These workers can run on a single node or across multiple nodes depending on the request and cluster scheduling. From here, you can execute MATLAB commands or scripts using a default set of cluster parameters.

To see the default cluster parameters use the following command:

>>c.AdditionalProperties

Various other parameters can be added or modified such as walltime, memory usage, GPUs, etc. For example:

>>c.AdditionalProperties.Walltime = '5:00:00';
>>c.AdditionalProperties.MemUsage = '4000';
>>c.AdditionalProperties.GpusPerNode = 1;

When finished, you can terminate this job using:

>>p.delete

Asynchronous Interactive Batch Jobs


CategoryHPC