User`s guide
Program Independent Jobs for a Supported Scheduler
7-11
Number Running: 0
Number Finished: 0
Task ID of Errors: []
Note that the job’s State property is pending. This means the job has not been queued
for running yet, so you can now add tasks to it.
The cluster’s display now includes one pending job, as shown in this partial listing:
c
Associated Jobs
Number Pending: 1
Number Queued: 0
Number Running: 0
Number Finished: 0
You can transfer files to the worker by using the AttachedFiles property of the job
object. For details, see “Share Code with the Workers” on page 7-16.
Create Tasks
After you have created your job, you can create tasks for the job using the createTask
function. Tasks define the functions to be evaluated by the workers during the running of
the job. Often, the tasks of a job are all identical. In this example, each task will generate
a 3-by-3 matrix of random numbers.
createTask(job1, @rand, 1, {3,3});
createTask(job1, @rand, 1, {3,3});
createTask(job1, @rand, 1, {3,3});
createTask(job1, @rand, 1, {3,3});
createTask(job1, @rand, 1, {3,3});
The Tasks property of job1 is now a 5-by-1 matrix of task objects.
job1.Tasks
ID State FinishTime Function Error
-----------------------------------------------------
1 1 pending @rand
2 2 pending @rand
3 3 pending @rand
4 4 pending @rand
5 5 pending @rand