createParallelJob - Create parallel job object

Syntax

pjob = createParellelJob()
pjob = createParallelJob(scheduler)
pjob = createParallelJob(..., 'p1', v1, 'p2', v2, ...)
pjob = createParallelJob(..., 'configuration', 'ConfigurationName',...)

Arguments

pjob

The parallel 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

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

pjob = createParallelJob(scheduler) creates a parallel job object at the data location for the identified scheduler, or in the job manager. Future modifications to the job object result in a remote call to the job manager or modification to data at the scheduler's data location.

pjob = createParallelJob(..., 'p1', v1, 'p2', v2, ...) creates a parallel job object with the specified property values. If an invalid property name or property value is specified, the object will not be created.

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.

pjob = createParallelJob(..., 'configuration', 'ConfigurationName',...) creates a parallel 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 parallel job object using the default configuration.

pjob = createParallelJob();

Add the task to the job.

createTask(pjob, 'rand', 1, {3});

Set the number of workers required for parallel execution.

set(pjob,'MinimumNumberOfWorkers',3);
set(pjob,'MaximumNumberOfWorkers',3);

Run the job.

submit(pjob);

Retrieve job results.

waitForState(pjob);
out = getAllOutputArguments(pjob);

Display the random matrices.

celldisp(out);
out{1} =
    0.9501    0.4860    0.4565
    0.2311    0.8913    0.0185
    0.6068    0.7621    0.8214
out{2} =
    0.9501    0.4860    0.4565
    0.2311    0.8913    0.0185
    0.6068    0.7621    0.8214
out{3} =
    0.9501    0.4860    0.4565
    0.2311    0.8913    0.0185
    0.6068    0.7621    0.8214

Destroy the job.

destroy(pjob);

See Also

createJob, createTask, findJob, findResource, submit

  


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