Main Content

Customize Behavior of Sample Plugin Scripts

When using the generic scheduler interface, you can modify the behavior of the plugin scripts by setting additional properties for a generic cluster profile or object using AdditionalProperties. For more information on the generic scheduler interface, see Configure Using the Generic Scheduler Interface.

Additional Properties

The sample plugin scripts allow you to set these properties.

Properties for All Schedulers

PropertyDescriptionData Type


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



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.

  • "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 array


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.



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.



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


String array


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



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.



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



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.



User name to log in to the cluster host machine.



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.


Properties Specific to Each Scheduler

 Properties for Slurm Only

 Properties for LSF Only

 Properties for Grid Engine Family Only

 Properties for PBS Only

 Properties for HTCondor Only

 Properties for AWS Batch Only

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.

  • In the MATLAB toolstrip, on the Home tab, in the Environment area, select Parallel > Create and Manage Clusters.

  • In the Cluster Profile Manager, click on the generic 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 AdditionalSubmitArgs for an LSF® cluster profile.

Cluster Profile Manager with the LSF 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 generic 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 an LSF cluster.

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

c = parcluster("MyLSFCluster");

Next, set AdditionalSubmitArgs so that the plugin scripts use a different job queue.

c.AdditionalProperties.AdditionalSubmitArgs = '-q matlab_queue';

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 Adding User Customization (Parallel Computing Toolbox).

Related Topics