If you have a cluster with Slurm, follow these instructions to integrate MATLAB® with your scheduler using MATLAB Parallel Server™. If you do not have an existing scheduler in your cluster, see: Install and Configure MATLAB Parallel Server for MATLAB Job Scheduler and Network License Manager.
These instructions guide you through the following tasks:
After you integrate MATLAB with Slurm, you can access workers in your cluster from a desktop MATLAB client session with Parallel Computing Toolbox™. Workers are MATLAB computational engines that typically correspond to a core.
The setup in these steps uses the network license manager.
To install MATLAB Parallel Server, you must activate your license. To activate your MATLAB Parallel Server license:
Navigate to https://www.mathworks.com/licensecenter.
Log into the Administrator’s MathWorks Account.
Select your MATLAB Parallel Server license, and click the Install and Activate tab.
At the rightmost side, under RELATED TASKS, select Activate to Retrieve License File.
Fill in the requested information. This information must refer to the machine that hosts the license manager. In these instructions, it is the head node. For more information, see Install License Manager.
After filling in the information, download or email the License File and copy the File Installation Key. These are used later in the process.
Note
Activation is not necessary for trials. Contact your sales representative to obtain the License File and the File Installation Key.
To save time and eliminate the need for the installer-based download process for each computer in your cluster, download the installation files prior to installation. Doing so facilitates installation in a large number of machines. If you have access to an Administrator’s account for your license, you can use the installer to download files without installing them. If not, contact the administrator of your license to obtain a copy of the installation files. For more information, see Download Products Without Installing (Installation and Licensing). When using the installer to download the files, choose the following options:
Select the appropriate operating system for the cluster nodes.
Select all products for download. MATLAB Parallel Server cannot run jobs requiring products that are not installed.
There are three server-side components of MATLAB Parallel Server:
The license manager, which hosts the MATLAB Parallel Server license used by each worker. For more information, see Install License Manager.
Your third-party job scheduler, which runs on the head node and manages jobs on your cluster. You integrate this scheduler with MATLAB Parallel Server. For more information, see Install License Manager and Configure Your Cluster.
MATLAB Parallel Server, which runs on the compute nodes. For more information, see Install Software on Compute Nodes.
Choose a computer node to host the license manager. For the installation, use the offline installer from the previous step. For more information on the offline installation procedure, see Install Products Using File Installation Key (Installation and Licensing).
Start the MATLAB installer from the installation files acquired in Get the Installation Files.
Select Use a File Installation Key, and continue through the prompts.
In the product selection, select only the license manager.
In the License File step, browse to your
license.lic
file (obtained from Activate Your MATLAB Parallel Server License).
Start the license manager.
This procedure is similar to Install License Manager. For more information on the offline installation procedure, see Install Products Using File Installation Key (Installation and Licensing).
Start the MATLAB installer from the installation files acquired in Get the Installation Files.
Select Use a File Installation Key and continue through the prompts.
Select all products. However, do not install the license manager. Alternatively, to save space, install only the products that the users of the cluster are licensed for.
Use the license.dat
file from the head node. You
can obtain this file from the matlabroot/etc
folder,
where matlabroot
is the MATLAB installation folder.
For best performance, install locally on each node. However, you can also install in a network share location.
Note
Install noninteractively (silently) instead if you want to
Install the software on a machine without graphical user interface (GUI).
Save the time that it takes to configure the installer for each compute node.
For more information, see Install Noninteractively (Installation and Licensing).
You can test the installation and licensing by running the following command in a
command-line interface. matlabroot
is the MATLAB installation folder. filename
is the
location to write the log file to, for example, a temporary location. You must have
write permissions in this
location.
matlabroot/toolbox/parallel/bin/checkLicensing -logfile filename
Note
You do not need to start the mjs service when you want to configure MATLAB Parallel Server for Slurm.
To use MATLAB Parallel Server, you must use a local desktop running MATLAB and Parallel Computing Toolbox. Install the MathWorks® products for which you are licensed, including Parallel Computing Toolbox, on the local desktops from which you want to submit jobs to the cluster. For help with this step, see Installation and Licensing.
Any MATLAB cluster workers that you start use dynamic licensing: they can use all the functionality you are licensed for in the MATLAB client, while checking out only MATLAB Parallel Server licenses in the cluster.
Next step | More information |
---|---|
Use out-of-the-box support If you meet all of these conditions.
| Follow Create a Cluster Profile Using Out-of-the-Box Support. |
Use the generic scheduler interface. | Follow Create a Cluster Profile Using the Generic Scheduler Interface. |
Start the Cluster Profile Manager. On the Home tab, in the Environment area, select Parallel > Create and Manage Clusters.
Create a new Slurm profile. In the Cluster Profile Manager, select Add Cluster Profile > Slurm.
To give it a different name, select the new profile and click Rename.
In the Properties tab, provide settings for the following fields.
(Optional) Set the Description field.
Set the JobStorageLocation to the location where you want job and task data to be stored. This location must be accessible to all the worker machines.
Note
Sharing JobStorageLocation
with
parallel computing products running different versions
is not recommended; each version on your cluster should
have its own
JobStorageLocation
.
Set the NumWorkers field to the number of workers you want to use with this profile, within the limitation of your licensing.
Set the ClusterMatlabRoot to the installation location of the MATLAB to be executed by the worker machines.
(Optional) Set the SubmitArguments to include any additional command arguments required by your particular cluster and scheduler.
After filling the fields, the dialog box looks like this:
Click Done to save your cluster profile.
Download the Slurm plugin scripts to interface with Slurm from the MATLAB client. On the Home tab, in the Environment area, click Add-Ons. In the Add-On Explorer, search for the add-on Parallel Computing Toolbox plugin for MATLAB Parallel Server with Slurm and install it. Alternatively, you can download the add-on from here: Slurm. To open it, double click it or drag it and drop it in MATLAB.
For more information on the generic scheduler interface, see Configure Using the Generic Scheduler Interface.
In this step you verify your cluster profile, and thereby your installation. You
can specify the number of workers to use when validating your profile. If you do not
specify the number of workers in the Validation
tab, then the validation will attempt to use as many workers as the value specified
by the NumWorkers
property on the Properties tab. You can specify a smaller number of workers to
validate your configuration without occupying the whole cluster.
If it is not already open, start the Cluster Profile Manager. On the Home tab, in the Environment area, select Parallel > Create and Manage Clusters.
Select your cluster profile in the listing.
Click the Validation tab.
Use the checkboxes to choose all tests, or a subset of the validation stages, and specify the number of workers to use when validating your profile.
Click Validate.
The Validation Results tab shows the output. The following figure shows the results of a profile that passed all validation tests.
Note
If your validation does not pass, contact the MathWorks install support team.
If your validation passed, you now have a valid profile that you can use in other
parallel applications. You can make any modifications to your profile appropriate
for your applications, such as NumWorkersRange
,
AttachedFiles
, AdditionalPaths
, etc.
To save your profile for other users, select the profile and click Export, then save your profile to a file in a convenient location. Later, when running the Cluster Profile Manager, other users can import your profile by clicking Import.
After you complete the configuration, you can submit jobs to the cluster. For examples, see Running Code on Clusters and Clouds.