createJob - Create job object in scheduler and client

Syntax

obj = createJob()
obj = createJob(scheduler)
obj = createJob(..., 'p1', v1, 'p2', v2, ...)
obj = createJob(..., 'configuration', 'ConfigurationName', ...)

Arguments

obj

The job object.

scheduler

The scheduler object created by findResource.

p1, p2

Object properties configured at object creation.

v1, v2

Initial values for corresponding object properties.

Description

obj = createJob() creates a job using the scheduler identified by the default parallel configuration and sets the property values of the job as specified in the default configuration.

obj = createJob(scheduler) creates a job object at the data location for the identified scheduler, or in the job manager. When you specify a scheduler without using the 'configuration' option, no configuration is used, so no configuration properties are applied to the job object.

obj = createJob(..., 'p1', v1, 'p2', v2, ...) creates a job object with the specified property values. For a listing of the valid properties of the created object, see the job object reference page (if using a job manager) or simplejob object reference page (if using a third-party scheduler). If an invalid property name or property value is specified, the object will not be created.

Note that the property value pairs can be in any format supported by the set function, i.e., param-value string pairs, structures, and param-value cell array pairs. If a structure is used, the structure field names are job object property names and the field values specify the property values.

If you are using a third-party scheduler instead of a job manager, the job's data is stored in the location specified by the scheduler's DataLocation property.

obj = createJob(..., 'configuration', 'ConfigurationName', ...) creates a job object using the scheduler identified by the configuration and sets the property values of the job as specified in that configuration. For details about defining and applying configurations, see Programming with User Configurations.

Examples

Construct a job object using the default configuration.

obj = createJob();

Add tasks to the job.

for i = 1:10
    createTask(obj, @rand, 1, {10});
end

Run the job.

submit(obj);

Retrieve job results.

out = getAllOutputArguments(obj);

Display the random matrix returned from the third task.

disp(out{3});

Destroy the job.

destroy(obj);

See Also

createParallelJob, createTask, findJob, findResource, submit

  


 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS