User`s guide

Program Independent Jobs for a Generic Scheduler
7-31
2. Create a Job
You create a job with the createJob function, which creates a job object in the
client session. The job data is stored in the folder specified by the cluster object's
JobStorageLocation property.
j = createJob(c)
This statement creates the job object j in the client session.
Note Properties of a particular job or task should be set from only one computer at a
time.
This generic scheduler job has somewhat different properties than a job that uses an
MJS. For example, this job has no callback functions.
The job’s State property is pending. This state means the job has not been queued for
running yet. This new job has no tasks, so its Tasks property is a 0-by-1 array.
The cluster’s Jobs property is now a 1-by-1 array of job objects, indicating the existence
of your job.
c
3. Create Tasks
After you have created your job, you can create tasks for the job. Tasks define the
functions to be evaluated by the workers during the running of the job. Often, the tasks
of a job are identical except for different arguments or data. In this example, each task
generates a 3-by-3 matrix of random numbers.
createTask(j, @rand, 1, {3,3});
createTask(j, @rand, 1, {3,3});
createTask(j, @rand, 1, {3,3});
createTask(j, @rand, 1, {3,3});
createTask(j, @rand, 1, {3,3});
The Tasks property of j is now a 5-by-1 matrix of task objects.
j.Tasks
Alternatively, you can create the five tasks with one call to createTask by providing a
cell array of five cell arrays defining the input arguments to each task.