Updated 2021-05-16

Matlab

Run MATLAB Interactively On Cluster

Screenshot

  • Please see the VNC guide for instructions on how to set up the Interactive VNC session

Start Matlab on VNC

  • Open terminal in vnc window by clicking top left Applications > System Tools > scroll down to Terminal
  • all commands here on will be typed in terminal in VNC
  • To see available versions of matlab run
module avail matlab
  • Load matlab module and start matlab
module load <version of matlab>  #example: module load matlab/r2020b
matlab
  • The MATLAB GUI will load on screen.

Screenshot

Set Up Parallel Environment MATLAB

  • For larger or longer multi-node jobs, use distributed MATLAB for parallel computing. This is the recommended path.

  • You can also use a parallel pool within your single interactive job, based on the number of cores you requested on a single node for your interactive job.

  • It will start automatically when functions such as parfor are run.
  • Read more about managing parallel pools here.
Control the Parallel Pool from the Matlab Desktop
  • Access pool preferences in the Home tab in the Environment section, go to Parallel > Parallel Preferences Screenshot
Programming Interface
  • to open a parallel pool based on your preference settings, use parpool
  • to open a pool of a specific size, use parpool(4)
  • these can be used in the command-line interface or when writing a Matlab script
  • more information about using parpool can be found here