MATLAB

Description

MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming. Using MATLAB, you can analyze data, develop algorithms, and create models and applications.

Home Page

http://www.mathworks.se/products/matlab/

Documentation

http://www.mathworks.se/help/matlab/

License

UiO has a site license for MATLAB.

Usage

Use

module avail MATLAB

to see which versions of matlab are available. Use

module load MATLAB

or

module load MATLAB/version

to get access to matlab.  To use the graphical interface of Matlab you need a X-server installed on your local machine (for example Xming or Xwin32 for Windows machines).

To run matlab in a job script, use

matlab -nodesktop < script.m

Warning: By default, Matlab will use all CPUs on the node! This means that one must either ask for all the CPUs on the node in the job script, or add the switch -singleCompThread to the matlab command line.

 

To run Matlab in parallel using up to 12 threads within a single node one need to put

#SBATCH --cpus-per-task=12

in the jobscript to ask for 12 cores within the same node. Then, for a parallel job in the Matlab-script one should do something like

pc = parcluster
pc.JobStorageLocation = getenv('SCRATCH')

to set up a cluster using the job specific scratch space issued by the queuing system.  Now,

parpool(pc,12)will set up a pool of 12 workers on the cluster for using 'parfor' or 'spmd'. See http://www.mathworks.se/help/distcomp/parpool.html

To set up an independent job on the cluster one can use

j = createJob(pc)

and issue this job with tasks. Have a look at http://www.mathworks.se/help/distcomp/createjob.html

 

We currently do not have a license for MATLAB Distributed Computing Server, hence multi-node jobs are not supported.

 

 

Did you find what you were looking for?
Published June 21, 2021 10:35 AM