parallel.Job
Access job properties and behaviors
Constructors
createCommunicatingJob
, createJob
, findJob
, recreate
getCurrentJob
(in the workspace of the MATLAB worker)
Container Hierarchy
Parent | parallel.Cluster |
Children | parallel.Task |
Description
A parallel.Job
object provides access to a job, which you create, define, and submit for execution.
Types
The following table describes the available types of job objects. The job type is determined by the type of cluster, and whether the tasks must communicate with each other during execution.
Job Type | Description |
---|---|
parallel.job.MJSIndependentJob | Job of independent tasks on MATLAB® Job Scheduler cluster |
parallel.job.MJSCommunicatingJob | Job of communicating tasks on MATLAB Job Scheduler cluster |
parallel.job.CJSIndependentJob | Job of independent tasks on CJS cluster |
parallel.job.CJSCommunicatingJob | Job of communicating tasks on CJS cluster |
Methods
Common to All Job Types
The following methods are common to all job object types.
cancel | Cancel job or task |
createTask | Create new task in job |
delete | Remove job or task object from cluster and memory |
diary | Display or save Command Window text of batch job |
fetchOutputs | Retrieve output arguments from all tasks in job |
findTask | Find task in job |
listAutoAttachedFiles | List of files automatically attached to job, task, or parallel pool |
load | Load workspace variables from batch job |
recreate | Create new job from existing job |
submit | Queue job in scheduler |
wait | Wait for job to change state |
CJS Jobs
CJS job objects have the following methods in addition to the common methods:
getTaskSchedulerIDs | Scheduler IDs of tasks in job |
Properties
Common to All Job Types
The following properties are common to all job object types.
Property | Description |
---|---|
AdditionalPaths | Folders to add to MATLAB search path of workers, specified as a character vector, string or string array, or cell array of character vectors |
AttachedFiles | Files and folders that are sent to workers, specified as a character vector, string or string array, or cell array of character vectors |
AutoAddClientPath | Specifies whether user-added-entries on the client's path are automatically added to each worker's path |
AutoAttachFiles | Specifies if dependent code files are automatically sent to workers |
CreateDateTime | Date and time when the job is created |
EnvironmentVariables | Names of environment variables that are sent to the workers |
FileStore | File storage of the job that is accessible even while the job is still running, specified as a FileStore object |
FinishDateTime | Date and time when the job finishes running |
ID | Job's numeric identifier |
JobData | Information made available to all workers for job's tasks |
Name | Name of job |
Parent | Cluster object containing this job |
RunningDuration | Current duration of the job, specified as a duration object |
StartDateTime | Date and time when the job starts running |
State | State of job: 'pending' , 'queued' , 'running' , 'finished' , or 'failed' |
StorageBytes | Number of bytes that the data for this job occupies in the job storage location |
SubmitDateTime | Date and time when the job is submitted to the queue |
Tag | Label associated with job |
Tasks | Array of task objects contained in job |
Type | Job type: 'independent' , 'pool' , or 'spmd' |
UserData | Information associated with job object |
Username | Name of user who owns job |
ValueStore | Data storage of the job that is accessible even while the job is still running, specified as a ValueStore object |
When you offload computations to workers, any files that the client needs for computations
must also be available on workers. By default, the client attempts to detect and attach
these files. To turn off automatic detection, set the AutoAttachFiles
property to false
. If the software cannot find all the files, or if
sending files from client to worker is slow, use one of these options.
If the files are in a folder that is not accessible on the workers, set the
AttachedFiles
property. The cluster copies each file you specify from the client to the workers.If the files are in a folder that is accessible on the workers, you can set the
AdditionalPaths
property instead. Use theAdditionalPaths
property to add paths to the MATLAB search path for each worker and avoid copying files unnecessarily from the client to the workers.
MATLAB Job Scheduler Jobs
MATLAB Job Scheduler independent job objects and MATLAB Job Scheduler communicating job objects have the following properties in addition to the common properties:
Property | Description |
---|---|
AuthorizedUsers | Users authorized to access job |
FinishedFcn | Callback function executed on client when this job finishes |
NumWorkersRange | Minimum and maximum limits for number of workers to run job |
QueuedFcn | Callback function executed on client when this job is submitted to queue |
RestartWorker | True if workers are restarted before evaluating first task for this job |
RunningFcn | Callback function executed on client when this job starts running |
Timeout | Time limit, in seconds, to complete job |
CJS Jobs
CJS independent job objects do not have any properties beyond the properties common to all job types.
CJS communicating job objects have the following properties in addition to the common properties:
Property | Description |
---|---|
NumWorkersRange | Minimum and maximum limits for number of workers to run job |
Communicating Jobs
MATLAB Job Scheduler communicating job objects and CJS communicating job objects have this property in addition to the common properties:
Property | Description |
---|---|
SpmdEnabled | Indication if pool type job can run spmd code (since R2024a) |
Help
To get further help on a particular type of parallel.Job
object, including a
list of links to help for its properties, type help
parallel.job.<job-type>
. For example:
help parallel.job.MJSIndependentJob
See Also
Version History
Introduced in R2012a