| Parallel Computing Toolbox™ | ![]() |
pjob = createParellelJob()
pjob = createParallelJob(scheduler)
pjob = createParallelJob(..., 'p1',
v1, 'p2', v2, ...)
pjob = createParallelJob(..., 'configuration', 'ConfigurationName',...)
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. |
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. When you specify a scheduler without using the 'configuration' option, no configuration is used, so no configuration properties are applied to the job object.
pjob = createParallelJob(..., 'p1', v1, 'p2', v2, ...) creates a parallel job object with the specified property values. For a listing of the valid properties of the created object, see the paralleljob object reference page (if using a job manager) or simpleparalleljob 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.
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. 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(..., '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.
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.8214Destroy the job.
destroy(pjob);
createJob, createTask, findJob, findResource, submit
![]() | createMatlabPoolJob | createTask | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |