In general, Calcul Québec servers do not provide site-wide licenses for Matlab. However, there may be installations which are licensed for specific individuals, or users from specific groups or institutions. The Matlab MDCS license on Guillimin may be used by any Guillimin user provided they have a valid Matlab license for their desktop computer.
Submitting Matlab Jobs
Submitting Single-core Jobs
All computationally intensive Matlab jobs must be submitted to the queuing system. Do not use the login nodes for any memory or cpu intensive tasks. Before submitting your job make sure that the path to Matlab distribution is added to your path in your .bashrc file.
The following batch file can be used to submit your Matlab job:
Submitting Multicore Jobs
You can use Matlab Parallel Toolbox, and do parallel computations with Matlab within one computing node. Parallel Toolbox allows you to use the number of workers up to the number of cores in the node, but not more than 12 (or the total number of cores on a reserved node). You use this feature in the same way you do it on your desktop, except that the job must be packed with submission script and sent to the scheduler for execution. The submission of this type of jobs is similar to that of OpenMP parallel jobs. Here is a submission script template:
In this script you are reserving 12 cores on one node, so you can open maximum 12 workers in your Matlab code. Do not forget to change "ppn" property according to the number of workers you are opening in your code. Also, do not forget that you can NOT reserve more than 1 node for your Matlab job, even parallelized with Parallel Toolbox.
A few hints about using Matlab on any big cluster:
- Use cluster only for really big computational tasks. If your fit (or any other task) takes ~15min, why not just to do it on your desktop or laptop.
- Remember that whatever you submit to the computing node, becomes "sealed" there. That means no online plotting is possible. Please, make necessary changes in your script. What people usually do, is to do heavy calculations on the cluster, and then later plot the resulting data on the workstation. If you absolutely need to plot something during calculation, it should be saved to a file without any GUI output.
- Matlab job is considered by cluster scheduler as any other serial or threaded job. You can use only a single node with number of cores from 1 to 12 (limited by Parallel Toolbox and number of cores each node has). Therefore, if you do not have previous experience, please read carefully the Running jobs page.
- Matlab jobs fall into the category of either serial or OpenMP jobs, depending on whether you use parallel toolbox or not.