(last updated: )
In this page:
The following guide describe how to load, configure and use matlab @ CINECA's cluster
Load the MATLAB module
login to Galileo cluster, and type
[user@node166 ~]$ module load profile/eng autoload matlab/r2017a
Configuration
Configure MATLAB to submit jobs will by default to the cluster rather than submit to the local node or local machine.
Cluster Configuration
Start MATLAB, without desktop.
[user@node166 ~]$ matlab -nodesktop
Configure MATLAB to run parallel jobs on your cluster by calling configCluster. For each cluster, configCluster only needs to be called once per version of MATLAB, and once per user.
>> configCluster
Local Configuration
After having installed MATLAB to your workstation
Configuring Jobs
Prior to submitting the job, various parameters have to be specified in order to be passed to jobs, such as queue, username, e-mail, etc.
NOTE: Any parameters specified using the below workflow will be persistent between MATLAB sessions.
Before specifying any parameters, you will need to obtain a handle to the cluster object.
>> % Get a handle to the cluster
>> c = parcluster;
You are required to specify an Account Name prior to submitting a job. You can retrieve your Account Name / Bugdet info by using the saldo command
>> % Specify an Account to use for MATLAB jobs
>> c.AdditionalProperties.AccountName = ‘account_name’
You can specify other additional parameters along with your job.
>> % Specify a queue to use for MATLAB jobs
>> c.AdditionalProperties.QueueName = ‘shared’
>> % Specify e-mail address to receive notifications about your job
>> c.AdditionalProperties.EmailAddress = ‘test@foo.com’
>> % Specify the walltime
>> c.AdditionalProperties.WallTime = '00:10:00'
>> % Specify processor cores per node. Default is 16.
>> c.AdditionalProperties.ProcsPerNode = 16
>> % Turn on the Debug Message. Default is off (logical 0).
>> c.AdditionalProperties.DebugMessagesTurnedOn = 1
To see the values of the current configuration options, call the specific AdditionalProperties name.
>> % To view current configurations
>> c.AdditionalProperties.QueueName
Or to see the entire configuration
>> c.AdditionalProperties
To clear a value, assign the property an empty value (‘’, [], or false).
>> % To clear a configuration that takes a string as input
>> c.AdditionalProperties.EmailAddress = ‘ ’
To save a profile, with your configuration ....
Serial Jobs
Use the batch command to submit asynchronous jobs to the cluster. The batch command will return a job object which is used to access the output of the submitted job. See the MATLAB documentation for more help on batch.
>> % Get a handle to the cluster
>> c = parcluster;
>> % Submit job to query where MATLAB is running on the cluster
>> j = c.batch(@pwd, 1, {});
>> % Query job for state: queued | running | finished
>> j.State
>> % If state is finished, fetch results
>> j.fetchOutputs{:}
>> % Delete the job after results are no longer needed
>> j.delete
To retrieve a list of currently running or completed jobs, call parcluster to retrieve the cluster object. The cluster object stores an array of jobs that were run, are running, or are queued to run. This allows us to fetch the results of completed jobs. Retrieve and view the list of jobs as shown below.
>> c = parcluster;
>> jobs = c.Jobs
Once we’ve identified the job we want, we can retrieve the results as we’ve done previously.
fetchOutputs is used to retrieve function output arguments; if using batch with a script, use load instead. Data that has been written to files on the cluster needs be retrieved directly from the file system.
To view results of a previously completed job:
>> % Get a handle on job with job array index 2 (2x1)j
>> j2 = c.Jobs(2);
NOTE: You can view a list of your jobs, as well as their IDs, using the above c.Jobs command.
>> % Fetch results for job with ID 2
>> j2.fetchOutputs{:}
>> % If the job produces an error view the error log file
>> c.getDebugLog(j.Tasks(1))
Parallel Jobs
Debugging
To learn More
Parallel Computing Benchmarck
Checking the license server
To check the license server status, please type:
[user@node165 ispisso0]$ module load profile/eng autoload matlab/r2017a
[user@node165 ispisso0]$ lmutil lmstat -a -c $MLM_LICENSE_FILE
Feature enabled:
Users of MATLAB: 5 licenses issued
Users of Distrib_Computing_Toolbox: 5 licenses issued
Users of MATLAB_Distrib_Comp_Engine: 32 licenses issued
To use Matlab, you have to be added to the unix group cin_matlab. Please ask for authorization to superc@cineca.it
dependences:
outgoing links: