User`s guide

Program Independent Jobs for a Generic Scheduler
7-25
Define Scheduler Command to Run MATLAB Workers
The submit function must define the command necessary for your scheduler to start
MATLAB workers. The actual command is specific to your scheduler and network
configuration. The commands for some popular schedulers are listed in the following
table. This table also indicates whether or not the scheduler automatically passes
environment variables with its submission. If not, your command to the scheduler must
accommodate these variables.
Scheduler Scheduler Command Passes Environment Variables
LSF bsub Yes, by default.
PBS qsub Command must specify
which variables to pass.
Sun™ Grid Engine qsub Command must specify
which variables to pass.
Your submit function might also use some of these properties and others when
constructing and invoking your scheduler command. cluster, job, and props (so
named only for this example) refer to the first three arguments to the submit function.
Argument Object Property
cluster MatlabCommandToRun
cluster ClusterMatlabRoot
job NumWorkersRange
props NumberOfTasks
Example — Write the Submit Function
The submit function in this example uses environment variables to pass the necessary
information to the worker nodes. Each step below indicates the lines of code you add to
your submit function.
1
Create the function declaration. There are three objects automatically passed into
the submit function as its first three input arguments: the cluster object, the job
object, and the props object.
function mysubmitfunc(cluster, job, props)