createMatlabPoolJob - Create MATLAB® pool job

Syntax

job = createMatlabPoolJob()
job = createMatlabPoolJob('p1', v1, 'p2', v2, ...)
job = createMatlabPoolJob(..., 'configuration', 'ConfigurationName',...)

Arguments

job

The job object.

p1, p2

Object properties configured at object creation.

v1, v2

Initial values for corresponding object properties.

Description

job = createMatlabPoolJob() creates a MATLAB pool job using the scheduler identified by the default parallel configuration.

job = createMatlabPoolJob('p1', v1, 'p2', v2, ...) creates a MATLAB pool job with the specified property values. If an invalid property name or property value is specified, the object is not created. These values will override any values in the default configuration.

job = createMatlabPoolJob(..., 'configuration', 'ConfigurationName',...) creates a MATLAB pool job 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 MATLAB pool job object.

j = createMatlabPoolJob('Name', 'testMatlabPooljob');

Add the task to the job.

createTask(j, @labindex, 1, {});

Set the number of workers required for parallel execution.

j.MinimumNumberOfWorkers = 5;
j.MaximumNumberOfWorkers = 10;

Run the job.

submit(j)

Wait until the job is finished.

waitForState(j, 'finished');

Retrieve job results.

out = getAllOutputArguments(j);

Display the output.

celldisp(out);

Destroy the job.

destroy(j);

See Also

createParallelJob, createTask, defaultParallelConfig, submit

  


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