Main Content

Customize Behavior of Sample Plugin Scripts

R2026b

Parallel Computing Toolbox™ uses a set of plugin scripts to define how the client communicates with your third-party scheduler. You can modify the behavior of the plugin scripts by setting additional properties for a third-party built-in or generic cluster profile or object using AdditionalProperties.

Additional Properties

The sample plugin scripts allow you to set these properties.

Properties for All Schedulers

PropertyDescriptionData Type

AdditionalSubmitArgs

Additional scheduler arguments for job submission. The sample plugin scripts add the value of this property to the scheduler submission string.

String

AuthenticationMode

Option to indicate how you are authenticated when you connect to the cluster, specified as one of the following:

  • "Agent" — The client interfaces with an SSH agent running on the client machine. SSH Agent authentication does not support keys in PPK format. Only keys in OpenSSH format are supported.

  • "IdentityFile" — The client uses the identity file specified by the IdentityFile additional property.

  • "Multifactor" – The client to prompts you for input one or more times. For example, if two-factor authentication (2FA) is enabled on the client, the client requests your password and a response for the second authentication factor.

  • "Password" – The client prompts you for your SSH password. Your user name is specified by the Username additional property.

String

String array

ClusterHost

Host name of the cluster machine that has the scheduler utilities to submit jobs. Use this if your cluster is unable to directly submit jobs to the scheduler.

The cluster machine must run Linux.

String

DisplaySubmitArgs

Option to display the job submission flags and options you pass to the scheduler when you submit a job. The flags and options are displayed on the command line.

Logical

FileTransferProtocol (since R2026a)

File transfer protocol to use when transferring files between the MATLAB® client and the remote cluster host, specified as one of these options:

  • "SFTP" (default) — Transfers files using the Secure File Transfer Protocol (SFTP). MATLAB uses SFTP by default to authenticate and encrypt file transfers with remote cluster hosts. Your cluster host must have the SFTP enabled.

  • "SCP" — Transfers files using the Secure Copy Protocol (SCP). Use SCP if your cluster has not enabled SFTP.

String

FileArchiveType (since R2026a)

File archive type to use when transferring files between the MATLAB client and the remote cluster host, specified as one of these options:

  • "Tar" (default) — Archives files using the TAR format. MATLAB uses this option by default to package file before transfer.

  • "None" — Transfers files without archiving. Use this option if the TAR utility is not installed on the cluster host.

String

IdentityFile

Location on the client machine of the SSH identity file that identifies you on the cluster host machine.

String

String array

IdentityFileHasPassphrase

Option to use passphrase for identity file. Set this property to true if IdentityFile requires a passphrase.

Logical

MPIImplementation (since R2025a)

Option to change the Message Passing Interface (MPI) implementation to use for your job on Linux® clusters, specified as one of the following:

  • "MPICH" - Run jobs using an MPICH version of the mpiexec command. By default, Parallel Computing Toolbox runs jobs using an MPICH implementation of MPI.

  • "IntelMPI" - Run jobs using an Intel® implementation of MPI.

String

RemoteJobStorageLocation

Location to store job files on the cluster. Use this property if your client and the cluster nodes do not have a shared file system.

String

SSHPort

Cluster host port number for SSH connections. Use this property to set the port on the cluster host to connect to via SSH.

Double

UseIdentityFile

Option to use an identity file. Set this property to true if you want to use an SSH identity file to log in to the cluster host machine. If you set this property, then also set IdentityFile and IdentityFileHasPassphrase.

Logical

Username

User name to log in to the cluster host machine.

String

UseUniqueSubfolders

Option to use unique subfolders. Set this property to true if you want MATLAB to store job files under different subfolders based on the user name and MATLAB version. Doing so helps to prevent conflicts between jobs submitted from different users and MATLAB versions.

Logical

Properties Specific to Each Scheduler

For more information about these properties, see the Slurm documentation.

PropertyDescriptionData Type

AccountName

Account name which the scheduler charges for the resources used.

String

Constraint

Node features required to run the job.

String

MemPerCPU

Minimum memory required per CPU.

String

Partition

Partition for the job's resource allocation.

String

RequireExclusiveNode

Option to share nodes with other running jobs. Set this property to true if the job cannot share nodes with other running jobs.

Logical

Reservation

Reservation name from which the scheduler can allocate resources for the job.

String

WallTime

Limit on the total run time of the job.

String

EmailAddress

Email address that receives notifications from the scheduler.

String

For more information about these properties, see the LSF documentation.

PropertyDescriptionData Type

MemPerCPU

Minimum memory required per CPU.

String

Project

Project to which the scheduler assigns the job.

String

QueueName

Cluster queue name on which the scheduler runs the job.

String

RequireExclusiveNode

Option to share nodes with other running jobs. Set this property to true if the job cannot share nodes with other running jobs.

Logical

WallTime

Limit on the total run time of the job.

String

EmailAddress

Email address that receives notifications from the scheduler.

String
PropertyDescriptionData Type

AccountName

Account name under which the scheduler runs the job.

String

MemPerCPU

Minimum memory required per CPU.

String

Project

Project to which the scheduler assigns the job.

String

QueueName

Cluster queue name that runs the job.

String

WallTime

Limit on the total run time of the job.

String

EmailAddress

Email address that receives notifications from the scheduler.

String
PropertyDescriptionData Type

AccountName

Account name which the scheduler charges for the resources used.

String

Priority

Priority of the job relative to other jobs in the cluster.

Double

ProcsPerNode

Number of processors per node, specified as a finite positive integer scalar.

When you submit a job to the cluster, the number of cores per node that MATLAB requests is guaranteed to be less than or equal to ProcsPerNode. Set ProcsPerNode equal to the maximum number of processors you want MATLAB to request from each cluster node.

MATLAB requests the smallest number of cores per node required to run the job.

  • If the NumThreads property of the cluster is less than or equal to ProcsPerNode, MATLAB requests NumThreads processors per worker, then maximizes the number of workers per node. For example if ProcsPerNode is 16 and NumThreads is 5, MATLAB requests 15 cores, the largest multiple of 5 that is less than ProcsPerNode.

  • If NumThreads of the cluster is greater than ProcsPerNode, MATLAB requests ProcsPerNode processors per node.

    When NumThreads is greater than ProcsPerNode, you might encounter performance issues. As a best practice, set NumThreads less than or equal to ProcsPerNode. For more information, see Edit Number of Workers and Cluster Settings (Parallel Computing Toolbox).

Positive integer scalar

QueueName

Cluster queue or server name that runs the job.

String

WallTime

Limit on the total run time of the job.

String

EmailAddress

Email address that receives notifications from the scheduler.

String

For more information about these properties, see the HTCondor documentation.

PropertyDescriptionData Type

AccountingGroup

Accounting group name under which the scheduler negotiates the job.String

AccountingGroupUsername

Username for resource usage accounting.

String

RequestDisk

Disk space requirements for the job.

String

RequestMemory

Memory requirements for the job.

String

Priority

Priority of the job relative to other jobs in the cluster.

Double

Requirements

Node features required to run the job.

String

EmailAddress

Email address that receives notifications from the scheduler.

String

For more information about these properties, see the AWS Batch documentation.

PropertyDescriptionData Type

IndependentJobDefinition

Definition of AWS® Batch job for independent MATLAB jobs.

String

JobQueue

AWS Batch job queue of the cluster

String

LicenseServer

Port number and hostname of a machine running a network license manager. Specify this property in the format port@hostname.

String

S3Bucket

Amazon S3™ bucket used for data transfer between client and MATLAB Parallel Server™ workers

String

Set Additional Properties

You can set additional properties in the cluster profile, with the Cluster Profile Manager, or programmatically.

Set Properties in Cluster Profile

When you set the additional properties in the cluster profile, the properties apply every time you use the cluster.

  • Open the Cluster Profile Manager. In the Parallel panel , to the right of the cluster profile that you want to modify, click the More Actions button , then click View Profile (since R2026b). Alternatively, on the Home tab, in the Environment area, select Parallel > Create and Manage Clusters.

  • In the Cluster Profile Manager, click on the cluster profile that you want to modify.

  • Click Edit at the bottom-right.

  • Go to the AdditionalProperties table.

  • To add a new property, click Add. To modify an existing property, click on the property.

The following image shows an example of setting the AdditionalSubmitArgs additional property on a Slurm cluster profile so that the plugin scripts add a comment to the job.

Cluster Profile Manager with the Slurm profile selected. The properties for the cluster are shown in the right panel. The Additional Properties entry is being edited.

Set Properties Programmatically

You can set additional properties programmatically by accessing the AdditionalProperties of a cluster object. Note that this action does not update the cluster profile and the properties only apply to that particular cluster object. The following is an example of how to set AdditionalSubmitArgs for a Slurm cluster.

First, create a cluster object by using the parcluster function. In the following code, change MySlurmCluster to the name of your cluster profile.

c = parcluster("MySlurmCluster");

Next, set AdditionalSubmitArgs so that the plugin scripts attach a comment to the job.

c.AdditionalProperties.AdditionalSubmitArgs = '--comment="my test job"';

With this change, MATLAB passes the additional arguments to the scheduler when you submit a job. For example, submit a batch job.

job = batch(c,"myScript");

For other examples of modifying the functionality of your plugin scripts at run time using the AdditionalProperties property, see Add User Customization.

See Also

Topics