Actions

Difference between revisions of "MATLAB"

From Montana Tech High Performance Computing

Line 1: Line 1:
MATLAB and the Parallel Computing Toolbox is installed. The Distributed Computing Server is not installed, so calculations are limited to single compute nodes. MATLAB jobs that do and do not use the Parallel Computing Toolbox can be submitted to [[TORQUE]] via a script containing:
+
MATLAB and the Parallel Computing Toolbox is installed. The Distributed Computing Server is not installed, so calculations are limited to single compute nodes.  
 +
 
 +
==Submitting MATLAB jobs==
 +
 
 +
MATLAB jobs that do and do not use the Parallel Computing Toolbox can be submitted to [[TORQUE]] via a script containing:
  
 
: <code style=display:block>#!/bin/sh<br>#PBS -l nodes=1:ppn=12<br>#PBS -N MatlabJob<br>#PBS -d /home/mtech/username<br>#PBS -S /bin/bash<br>#PBS -j oe<br>#PBS -l walltime=00:15:00<br>matlab -nodesktop -nosplash -r "your_matlab_program(input_parameters);quit;"</code>
 
: <code style=display:block>#!/bin/sh<br>#PBS -l nodes=1:ppn=12<br>#PBS -N MatlabJob<br>#PBS -d /home/mtech/username<br>#PBS -S /bin/bash<br>#PBS -j oe<br>#PBS -l walltime=00:15:00<br>matlab -nodesktop -nosplash -r "your_matlab_program(input_parameters);quit;"</code>
Line 9: Line 13:
 
where matlabjob contains the above script updated with your program and username info.
 
where matlabjob contains the above script updated with your program and username info.
  
 +
==Running MATLAB interactively in command line==
 
If you wish to run MATLAB interactively without the Desktop GUI, start an interactive job on a compute node with:
 
If you wish to run MATLAB interactively without the Desktop GUI, start an interactive job on a compute node with:
 
:<code>msub -I -l nodes=1:ppn=12</code>
 
:<code>msub -I -l nodes=1:ppn=12</code>
Line 16: Line 21:
 
:<code style=display:block>[smith@scyld Matlab]$ qsub -I -l nodes=1:ppn=12<br>qsub: waiting for job 4007.scyld.localdomain to start<br>qsub: job 4007.scyld.localdomain ready<br><br>[smith@n0 ~]$</code>
 
:<code style=display:block>[smith@scyld Matlab]$ qsub -I -l nodes=1:ppn=12<br>qsub: waiting for job 4007.scyld.localdomain to start<br>qsub: job 4007.scyld.localdomain ready<br><br>[smith@n0 ~]$</code>
  
 +
==MATLAB GUI on headnode==
 
The MATLAB Desktop GUI is currently limited to the management node. You will need to either use NX or run an xserver. Please respect other users and avoid long computational runs on the management node if other users are on the system.
 
The MATLAB Desktop GUI is currently limited to the management node. You will need to either use NX or run an xserver. Please respect other users and avoid long computational runs on the management node if other users are on the system.

Revision as of 15:09, 9 February 2018

MATLAB and the Parallel Computing Toolbox is installed. The Distributed Computing Server is not installed, so calculations are limited to single compute nodes.

Submitting MATLAB jobs

MATLAB jobs that do and do not use the Parallel Computing Toolbox can be submitted to TORQUE via a script containing:

#!/bin/sh
#PBS -l nodes=1:ppn=12
#PBS -N MatlabJob
#PBS -d /home/mtech/username
#PBS -S /bin/bash
#PBS -j oe
#PBS -l walltime=00:15:00
matlab -nodesktop -nosplash -r "your_matlab_program(input_parameters);quit;"

Since MATLAB is multithreaded, you should request 12 ppn even if you are not using the Parallel Computing Toolbox. For parallel MATLAB jobs, the matlabpool is limited to the physical core only, that is 16 workers per compute node..

Use msub to submit your job script to TORQUE.

msub matlabjob

where matlabjob contains the above script updated with your program and username info.

Running MATLAB interactively in command line

If you wish to run MATLAB interactively without the Desktop GUI, start an interactive job on a compute node with:

msub -I -l nodes=1:ppn=12

This will return with a command prompt on a compute node, for example:

[smith@scyld Matlab]$ qsub -I -l nodes=1:ppn=12
qsub: waiting for job 4007.scyld.localdomain to start
qsub: job 4007.scyld.localdomain ready

[smith@n0 ~]$

MATLAB GUI on headnode

The MATLAB Desktop GUI is currently limited to the management node. You will need to either use NX or run an xserver. Please respect other users and avoid long computational runs on the management node if other users are on the system.