Overview
Matlab for unit without their own licenses#
The DSI offers some Matlab shared licenses for temporary usage. If you are a frequent user of matlab, consider buying your own licenses. You can ask for making them accessible from the cluster and dedicated to your unit as explained in section
How to see if licenses are available#
For commercial softwares working with network licenses such as Matlab, to see if some licenses are still available, type:
Code Block (bash)
login@maestro $ scontrol show lic
LicenseName=matlab@licserv
Total=3 Used=0 Free=3 Remote=yes
How to use Matlab in command-line mode#
To use Matlab add --pty option to be able to use the arrows to retrieve a former command.
Code Block (bash)
login@maestro $ module av matlab
----------------------------------------- /opt/gensoft/modules ---------------------------------------
matlab/R2020b matlab/R2021a matlab/R2021b matlab/R2022a(default)
login@maestro $ module load matlab
login@maestro $ srun --pty matlab
Another way to use Matlab is to use salloc instead of srun. Once the allocation is granted, load the chosen version of Matlab and launch it:
Code Block (bash)
login@maestro $ salloc
salloc: Granted job allocation 1354582
login@maestro-1005 $ module load matlab/R2022a
login@maestro-1005 $ matlab
To optimize the license usage, if you are going to launch several small Matlab jobs, prefer to allocate a container (with salloc or sbatch) once and for all with the corresponding number of CPUs and licenses. Only one license per node is required.
Let's say that you have a function my_function in the my_function.m file that takes an integer as parameter and that you want to run 95 times that function with a different value each. You just have to ask for 2 licenses for 2 nodes. In this case, since you don't want to inherit the number of nodes and tasks in your srun command, you have to reset the corresponding options:
Code Block (bash)
login@maestro $ salloc -N 2 -n 95 -L matlab@licserv:2
salloc: Granted job allocation 1354582
login@maestro-1005 $ module load matlab/R2020a
login@maestro-1005 $ for i in {1..95} ; do srun --exact -n 1 -N 1 -o my_function_%J.out matlab -nodisplay -nosplash -nodesktop -r "my_function(${i})" & done; wait
You can of course do the same in a script and call different Matlab scripts:
Code Block (bash)
#!/usr/bin/env bash
#SBATCH -N 2 -n 95 -L matlab@licserv:2
source /local/gensoft2/adm/etc/profile.d/modules.sh
module purge
module load matlab/R2020a
srun --exact -N 1 -n 95 -o script1_%J.out matlab -nodisplay -nosplash -nodesktop -r script1 &
srun --exact -N 1 -n 95 -o script2_%J.out matlab -nodisplay -nosplash -nodesktop -r script2 &
wait
exit 0
How to use Matlab in graphical mode#
You must have followed the procedure described on page first to be able to do the following.
If you want to use the graphic interface, add option --x11 to your srun:
Code Block (bash)
login@maestro $ srun -L matlab@licserv --pty --x11 matlab
Code Block (text)
Matlab for units with their own licenses#
How to make your Matlab and ToolBox licenses accessible on the cluster#
You must contact ask-hpc@pasteur.fr if you need to:
- transform your Individual licenses into Concurrent ones (required to be able to use them on cluster nodes, whatever you own the nodes or not)
- have your Concurrent licenses integrated into the centralized license server to be able to access them from the cluster nodes
- add new users from you team to access your licenses on the cluster
How to use license belonging to your research unit on the cluster#
Contrary to non-license-owners:
- you must NOT put
-L matlab@licservon your command line since it is only used to decrement the number of shared licenses in use - you are restricted to version
R2018aand above
Related articles#
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
false5FAQAfalsemodifiedtruepagelabel in ("clc","clcbio","matlab") and type = "page" and space = "FAQA"matlab clcbio clc
true
| Related issues |