Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Configure for a Generic Scheduler

The generic scheduler interface provides flexibility to configure how the MATLAB® client, MATLAB workers, and third-party scheduler interact. Use the generic scheduler interface when you want complete customization for interfacing MATLAB with your scheduler's setup.

Note

You must use the generic scheduler interface when:

  • Interfacing MATLAB with third-party schedulers not already supported by direct integration. Schedulers supported by direct integration include SLURM, PBS Pro, Torque, LSF, and HPC Server.

  • Interfacing MATLAB and third-party schedulers which do not have a shared file system between the MATLAB client and the cluster nodes.

  • Using a MATLAB client machine that does not have the third-party scheduler’s utilities installed.

Interfacing with Generic Schedulers

The generic scheduler interface provides a means of getting tasks from your Parallel Computing Toolbox™ client session to your scheduler and cluster nodes. To achieve this, you must provide the generic scheduler with a set of integration scripts. These scripts contain instructions specific to your cluster infrastructure, such as how to communicate with the job scheduler, and how to transfer job and task data to cluster nodes.

Support Scripts

To support usage of the generic scheduler interface, there are integration scripts available for the following third-party schedulers:

Each installer provides scripts for three possible submission modes:

  • Shared – When the client can submit directly to the scheduler and there is a shared file system present between the client and the cluster machines.

  • Remote – When there is a shared file system present between the client and cluster machines, but the client machine cannot submit directly to the scheduler (for example the scheduler’s client utilities are not installed). In this case, a remote host submits commands to the scheduler using the ssh protocol.

  • Nonshared – When there is not a shared file system between the client and cluster machines. This mode uses the ssh protocol to submit commands to the scheduler using a remote host, and the sftp protocol to copy job and task files to the cluster file system.

Each submission mode has its own subfolder within the installation folder. These subfolders contain a file named README that provides specific instructions on how to use the scripts. Before using the scripts, decide which submission mode describes your network setup.

To run the installer, download the appropriate package for your scheduler and open it in your MATLAB client. The installer includes a wizard to help guide you through creating a cluster profile for your cluster configuration.

If your scheduler or cluster configuration is not supported by one of the above packages, it is recommended that you modify the scripts of one of the previous solutions. For more information on how to write a set of integration scripts for generic schedulers, see Integration Scripts for Generic Schedulers (Parallel Computing Toolbox).

Creating a Generic Cluster Profile

Example Setup for LSF

This section provides example guidelines for setting up your cluster profile to use the generic scheduler interface. The example shows the set up of an LSF scheduler in a network without a shared file system between the client and the cluster machines. The following diagram illustrates the cluster setup:

In this type of configuration, job data is copied from the client host running a Windows operating system to a host on the cluster (cluster login node) running a UNIX® operating system. From the cluster login node, the LSF bsub command submits the job to the scheduler. When the job finishes, its output is copied back to the client host.

Requirements

The setup must meet the following conditions:

  • The client node and cluster login node must support ssh and sftp.

  • The cluster login node must be able to call the bsub command to submit a job to an LSF scheduler. You can find more about this in the README file in the nonshared subfolder within the installation folder.

If these requirements are met, use the following steps to implement the solution:

Step 1: Run the LSF Installer

  1. Download the installer for LSF from IBM Platform LSF.

  2. Run the installer by opening the installer file from within your MATLAB client.

The installer downloads the integration scripts to the nonshared subfolder within the installation folder. The installer wizard guides you through the steps to create and validate a cluster profile.

Step 2: Validate Cluster Profile.  In this step, you validate your cluster profile and 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 attempts 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.

  1. If it is not already open, start the Cluster Profile Manager from the MATLAB desktop. To do this, select Parallel > Manage Cluster Profiles on the Home tab in the Environment area.

  2. Select your cluster profile in the listing.

  3. Click the Validation tab.

  4. 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.

  5. 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 fails any stage, 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, or AdditionalPaths.

To save your profile for other users, select the profile and click Export. Then save your profile to a file in a convenient location. When running the Cluster Profile Manager, other users can import your profile by clicking Import.

To learn how to distribute a generic cluster profile and integration scripts for others to use, see Distribute a Generic Cluster Profile and Integration Scripts.

Manually Configure a Cluster Profile.  If you want to modify an existing Generic cluster profile, you can configure the profile manually. If you are creating the profile for the first time and you are using one of the provided support scripts, use the installer wizard instead: Step 1: Run the LSF Installer.The following steps reproduce manually the configuration performed by the installer. You can modify any of these options depending on your setup.

  1. Start a MATLAB session on the client host.

  2. Start the Cluster Profile Manager from the MATLAB desktop by selecting Parallel > Manage Cluster Profiles.

  3. Create a new profile in the Cluster Profile Manager by selecting Add > Custom > Generic.

  4. With the new profile selected in the list, select Rename and change the profile name to InstallTest. Press Enter.

  5. In the Properties tab, select Edit and provide settings for the following fields:

    1. Set the Description field to For testing installation.

    2. Set the JobStorageLocation to the location where you want job and task data to be stored on the client machine (not the cluster location), for example, C:\Temp\joblocation.

      Note

      You must not share JobStorageLocation among parallel computing products running different versions. Each version on your cluster must have its own JobStorageLocation.

    3. Set NumWorkers to the number of workers for which you want to test your installation.

    4. Set NumThreads to the number of threads to use on each worker.

    5. Set ClusterMatlabRoot to the installation location of the MATLAB to be executed by the worker machines.

    6. If the cluster uses MathWorks hosted licensing, then set RequiresMathWorksHostedLicensing to true.

    7. If you have set RequiresMathWorksHostedLicensing to true in step f., then enter your LicenseNumber.

    8. Set the OperatingSystem to the operating system of your cluster worker machines.

    9. Set HasSharedFilesystem to false. This indicates that the client node and worker nodes cannot share the same data location.

    10. Set the IntegrationScriptsLocation to the location of your integration scripts. In this example, this is the nonshared subfolder within the LSF installation folder. As part of using the example scripts in nonshared submission mode, you must set the properties in steps k. and l.

    11. In the AdditionalProperties table, select Add. Specify a new property with name ClusterHost, value cluster-host-name, and type String.

    12. In the AdditionalProperties table, select Add. Specify a new property with name RemoteJobStorageLocation, value /network/share/joblocation, and type String.

  6. Click Done to save your cluster profile changes. The dialog box looks as follows:

To check that the profile works, perform a validation following the steps in Step 2: Validate Cluster Profile.

Special Configurations

Depending on your cluster architecture, follow the steps in the next sections as needed before you connect to your generic scheduler.

Custom MPI builds

You can use an MPI build that differs from the one provided with Parallel Computing Toolbox™. For more information about using this option with the generic scheduler interface, see Use Different MPI Builds on UNIX Systems.

Run Communicating Jobs with the Grid Engine Family

The example scripts for Grid Engine family rely on the presence of a matlab parallel environment. Parallel environments are programming environments designed for parallel computing in clusters. To run communicating jobs with MATLAB Distributed Computing Server™ and a Grid Engine family cluster, you must establish a matlab parallel environment.

Create the Parallel Environment.  The following steps create the parallel environment (PE), and then make the parallel environment runnable on all queues. It is recommended that you perform these steps on the head node of your cluster. To perform some of these steps, you need administrator access.

  1. Download and run the installer for Grid Engine from Grid Engine family.

  2. Navigate to the location of the relevant integration scripts for your submission mode in the installation folder.

  3. Modify the contents of matlabpe.template to use the desired number of slots and the correct location of the startmatlabpe.sh and stopmatlabpe.sh files. These files can exist in a shared location accessible by all hosts, or they can be copied to the same location on each host. You can also change other values or add additional values to matlabpe.template to suit your cluster. For more information, refer to the sge_pe documentation provided with your scheduler.

  4. Add the matlab parallel environment, using a shell command like:

    qconf -Ap matlabpe.template

  5. Make the matlab parallel environment runnable on all queues:

    qconf -mq all.q
    This brings up a text editor for you to make changes. Search for the line pe_list, and add matlab.

  6. Ensure you can submit a trivial job to the PE:

    $ echo "hostname" | qsub -pe matlab 1

  7. Use qstat to check that the job runs correctly, and check that the output file contains the name of the host that ran the job. The default file name for the output file is ~/STDIN.o###, where ### is the Grid Engine job number.

Note

If you change the name of the parallel environment to something other than matlab, you must ensure that you also change the submit functions.

Configure Firewalls on Windows Cluster

If you are using Windows firewalls on your cluster nodes, you can add MATLAB as an allowed program:

In the following instructions, matlabroot refers to the MATLAB installation location.

  1. Log in as a user with administrative privileges.

  2. Execute the following script in a DOS command window:

    matlabroot\toolbox\distcomp\bin\addMatlabToWindowsFirewall.bat

If you are using other firewalls, you must configure these separately to add MATLAB as an allowed program.

Related Topics

Was this topic helpful?