...
To do so you first need to configure the O2 cluster profile in the MATLAB version being used which is done running the command configCluster
NOTE:
It is strongly recommended to use MATLAB version 2019a or later when submitting multi-node jobs (mpi partition) with MATLAB O2 cluster profile. Earlier versions of MATLAB are using a mechanism to start the MATLAB workers that is not fully compatible with our existing SLURM epilog and could cause jobs to be killed.
Setting up the O2 MATLAB Cluster Profile
Code Block |
---|
>> configCluster
Must set WallTime and QueueName before submitting jobs to O2. E.g.
>> c = parcluster;
>> % 5 hour walltime
>> c.AdditionalProperties.WallTime = '05:00:00';
>> c.AdditionalProperties.QueueName = 'queue-name';
>> c.saveProfile
>> |
now your default cluster profile is set to o2 local R2019a and you should be able to verify it by running the command parcluster
Code Block |
---|
>> parcluster ans = Generic Cluster Properties: Profile: o2 R2019a Modified: false Host: compute-a-16-22 NumWorkers: 100000 NumThreads: 1 JobStorageLocation: /home/abc123/MdcsDataLocation/o2/R2019a ClusterMatlabRoot: /n/app/matlab/2019a OperatingSystem: unix RequiresOnlineLicensing: false IntegrationScriptsLocation: /n/app/matlab/2019a/toolbox/local/IntegrationScripts/o2 AdditionalProperties: List properties Associated Jobs: Number Pending: 0 Number Queued: 0 Number Running: 0 Number Finished: 0 >> |
Note 1: The configCluster command needs to be executed only on time
Note 2: After running the configCluster command the default cluster profile is set to the O2 cluster, if you want to go back and use the "local" cluster profile you can change the default profile using the command parallel.defaultClusterProfile('local')
...
Expand | ||||
---|---|---|---|---|
| ||||
In order to use the O2 MATLAB cluster profile it is required to define at least two submission parameters: the partition to be used and the desired wall-time. In MATLAB 2016b this can be done with the command ClusterInfo.set+Property for example:
Note: In the above example the partition "mpi" is used to set the parameter ClusterInfo.setQueueName, however the MATLAB O2 Cluster Profile can be used with any of the partitions available on the O2 cluster. Several other parameter can be defined in a similar way, this below is the complete list available:
The command ClusterInfo.setUserDefinedOptions can be used to pass additional flag to the scheduler. For example ClusterInfo.setUserDefinedOptions('-o output.log') will pass the flag -o output.log to the scheduler when submitting a job from within MATLAB. Similarly Similarly the command ClusterInfo.get+Property can be used to check the assigned Property Note that, once assigned, each property will be saved in the user ~/.matlab profile folder and will not need to be re-defined unless a change is desired (i.e. different wall-time, partition, amount of memory, etc.) |
Define job submission flags for Version ≥ R2017a
In order to use the O2 MATLAB cluster profile it is required to define at least two submission parameters: the partition to be used and the desired wall-time. This can be done assigning done assigning the properties directly to a parcluster object c as shown in the example below:
...
Important: Use --mem-per-cpu (or the flag c.AdditionalProperties.MemUsage) instead of --mem to request custom amount of memory when using the mpi partition. The slurm flag --mem is used to request a given amount of memory per node, so, unless you are enforcing a balanced distribution of tasks (i.e. MATLAB workers) per node, you might end up with too much or not enough memory on a given node, depending on how the tasks are allocated.
...