MDCS


Directory list:

VersionDescription
nsc2 Matlab [Link]
nsc3 Matlab [Link]
This is the program version that is currently recommended by NSC.

Level of support

Tier 3 NSC will not be able to help you much with this program, either because we lack the in-house experience, or because it is a test installation. In general, these types of installations are untested, and will not be updated unless you send a request to NSC.

Please see the page describing our software support categories for more information.
You can also contact support@nsc.liu.se for further information.

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.

Starting Matlab

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/R2013a-mdcs

Start matlab:

[paran@triolith3 ~]$ matlab

Initial setup

The first time you use MDCS you need to create a cluster profile. To do this start Matlab and run the following command:

>> configCluster('triolith')

This will create a cluster profile named triolith_local_r2013a and set as your default.

Matlab will remember your cluster profile, so you only have to run this once.

Configure job parameters

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.

Examples:

Reset ClusterInfo state

>> ClusterInfo.clear

Show ClusterInfo state

>> ClusterInfo.state

                   Arch : 
            ClusterHost : 
           EmailAddress : 
            GpusPerNode : 
               MemUsage : 
         PrivateKeyFile : 
           ProcsPerNode : 
            ProjectName : 
              QueueName : 
            Reservation : 
                 UseGpu : 0
     UserDefinedOptions : 
      UserNameOnCluster : 
               WallTime : 

Specify job walltime limit:

>> ClusterInfo.setWallTime('1:0:0')

Specify project name for job:

>> ClusterInfo.setProjectName('snic2013-X-Y')

After running the last four example commands ClusterInfo.state would look like this:

>> ClusterInfo.state                  

                   Arch : 
            ClusterHost : 
           EmailAddress : 
            GpusPerNode : 
               MemUsage : 
         PrivateKeyFile : 
           ProcsPerNode : 
            ProjectName : snic2013-X-Y
              QueueName : 
            Reservation : 
                 UseGpu : 0
     UserDefinedOptions : 
      UserNameOnCluster : 
               WallTime : 1:0:0

Specify reservation to use. For example to use the development reservation for short test jobs:

>> ClusterInfo.setReservation('devel')

Run a batch job

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','matlabpool',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.