Skip to end of metadata
Go to start of metadata

Running MATLAB with the GUI for Code Development

if you need to run MATLAB on one of the clusters to develop your code and run short (30 minutes or less) tests of the code, please follow these instructions.

1.  Login to the Cluster

Login to the cluster using our published instructions . 

Windows users will need to use Xming in order to run the MATLAB GUI on the cluster and have it displayed on their desktop. 

2.  Load the MATLAB Environment

Load the MATLAB module with the following command:

3.  Run MATLAB

To run MATLAB with our without the GUI as follows:

This will start MATLAB with and without the GUI, respectively.

At this point MATLAB will be running interactively on one of the login nodes, not one of the compute nodes. When you get the matlab prompt, start writing your code as your normally would. This method of running MATLAB is intended for code development and for executing short test runs of your code (30 minutes or less).

Do not run full length compute jobs on the login nodes

Do not run full length compute jobs on the login nodes.  Use one of the methods below for submitting a compute job to a job queue.

Submitting Interactive Jobs

If you need to run a MATLAB compute job interactively, please follow these instructions.

1.  Login to the Cluster

Login to the cluster using our published instructions

Windows users will need to use Xming in order to run the MATLAB GUI on the cluster and have it displayed on their desktop. 

2.  Load the MATLAB Environment

Load the MATLAB module with the following command:

3.  Submit an Interactive Slurm Job

Submit an interactive SLURM job as follows:

Change the --ntasks value to suit your job.

You will notice that the command prompt has changed from a login node designation to a compute node designation.

Interactive Jobs Might Not Run Immediately

At present this type of job submission will compete with all other jobs on the system for run time. If no nodes are available then the job submission will pause and a command prompt on a compute node will not be presented until an idle node is available. This should not be a problem during periods when cluster utilization is low. When cluster utilization is high, this wait time could be lengthy.

Job Submission Must Satisfy Cluster Queue Policy

Job submissions of this type must satisfy the queue policy on each cluster or the job will not execute.  For example, NOTS requires that jobs submitted to the default partition request one node only, whereas on DAVinCI this restriction is not in place.  Consult the documentation for each cluster for the queue policy.

4.  Launch MATLAB

After you have obtained a command line prompt on a compute node, launch MATLAB with or without the GUI. An example without the GUI is shown below.

From the prompt you can run any MATLAB command that you wish.

MATLAB will terminate when the walltime has been exceeded

Your MATLAB  session will be terminated when its run time (walltime) has been reached.

You must remain logged into the cluster for this job to execute

You will need to remain logged into the cluster for this interactive session to execute. If you terminate your login, MATLAB will also terminate. Therefore, using the interactive method is not a good choice for a job that is going to run for many hours.

To run MATLAB with the GUI, simply run the matlab command on the compute node without the -nodisplay option.  The GUI will perform more slowly than if you were running in on your desktop since the graphics are being transmitted from a compute node to your desktop.

  • No labels