The University of York has licences for the MATLAB Parallel Computing Toolbox (PCT) and the MATLAB Distributed Computing Toolbox. See this link for further information on the Parallel Computing Toolbox.
Matlab parallel computing will allow you to submit your Matlab jobs (either through the Matlab GUI or via the command line) to Viking. Instructions on how to do this will be described here.
NB. It is best to run Matlab in your scratch directory on Viking since the output files can fill up the space on your home directory. You can run it either through the matlab gui or on the command line.
Before starting load the Matlab module.
Submitting Matlab workloads to Slurm using the Matlab GUI
With Matlab it is possible to submit jobs to Slurm using the Matlab gui. We will describe below how to create a cluster profile and run your jobs using Slurm.
Creating a cluster profile.
If you prefer to use the Matlab gui, you can also create a cluster profile that can be reused.
You can either create your own profile or use an existing one. Instructions on how to create a profile can be found here. Follow the guides for Slurm.
Adding an existing cluster profile
To add an existing cluster profile follow these steps.
- Download the example profile (vikingprofile.mlsettings) and move it to the location where you will launch the Matlab GUI.
- To access the cluster profile menu, select "Manage cluster profiles..." from the parallel option in the home tab.
- In the Cluster Profile Manager click on import and then select the file.
Once the profile is loaded, you will need to edit some of the lin
- The folder where you will store the output of your jobs
- In the submit functions settings: adapt these to what you need and remember to change your project code.
- Memory is set at the minimum value for the JAVA engine to run Matlab
To use the profile, you need to call it in your Matlab program. Below is an example where slurm is used on Viking to submit the test_for.m code below. If you wish to try with these scripts you will need to adapt the file paths accordingly. You can also increase the number of tasks that can run at any one type using the NumWorkersRange values. It is currently set to a max of 2.
Once you have submitted your jobs to Viking , job progress can be viewed in two ways.
Using the command line
Using Matlab to monitor the jobs
Select Monitor Jobs option from parallel option in the home tab.
Submitting Matlab jobs via the command line
You can also sumit jobs on the command line using the following