Software installations
Directory list:
Version | Description |
---|---|
nsc1 | Matlab [Link] |
This page contains NSC specific documentation about using MDCS on our clusters.
For full documentation about running parallell jobs in Matlab please read Mathworks Parallel Computing Toolbox documentation.
Log on to Triolith. To use the Matlab GUI we recommend that you log on using ThinLinc.
Load the Matlab module:
[paran@triolith3 ~]$ module add matlab/R2014a
Start matlab:
[paran@triolith3 ~]$ matlab
The first time you use MDCS you need to create a cluster profile. To do this start Matlab and run the following command:
>> configCluster()
[1] gamma
[2] triolith
Select a cluster [1-2]: 2
This will create a cluster profile named triolith_local_r2014a
and
set as your default.
Matlab will remember your cluster profile, so you only have to run this once.
You can now submit jobs using Matlab. To add parameters to the jobs
that Matlab will submit to the queue you use ClusterInfo
.
All jobs need to specify WallTime
, and most will need to specify ProjectName
.
>> ClusterInfo.clear
>> ClusterInfo.state
Arch :
ClusterHost :
EmailAddress :
GpusPerNode :
MemUsage :
PrivateKeyFile :
ProcsPerNode :
ProjectName :
QueueName :
Reservation :
UseGpu : 0
UserDefinedOptions :
UserNameOnCluster :
WallTime :
>> ClusterInfo.setWallTime('01:00:00')
>> ClusterInfo.setProjectName('snic2014-X-Y')
>> ClusterInfo.state
Arch :
ClusterHost :
EmailAddress :
GpusPerNode :
MemUsage :
PrivateKeyFile :
ProcsPerNode :
ProjectName : snic2014-X-Y
QueueName :
Reservation :
UseGpu : 0
UserDefinedOptions :
UserNameOnCluster :
WallTime : 01:00:00
>> ClusterInfo.setReservation('devel')
The following small example use MDCS to submit a batch job:
If you have the following Matlab code in a file named rndmat.m
:
parfor i=1:524288
A(i) = rand()
end
You can use the following commands to submit it as a batch using 3
workers. One core will also run the script itself, so in total this
job will use 4
cores:
>> job = batch('rndmat','pool',3)
To wait for the job to finish, then load the results A you can run:
>> wait(job)
>> load(job,'A')
Alternatively, in the Matlab GUI you can click on Parallell >
Monitor Jobs
to monitor your job.