| Parallel Computing Toolbox™ | ![]() |
Job = dfevalasync(F, numArgOut, x1,...,xn,
'P1',V1,'P2',V2,...)
Job = dfevalasync(F, numArgOut, x1,...,xn,
... 'configuration', 'ConfigurationName',...)
Job | Job object created to evaluation the function. |
F | Function name, function handle, or cell array of function names or handles. |
numArgOut | Number of output arguments from each task's execution of function F. |
x1, ..., xn | Cell arrays of input arguments to the functions. |
'P1', V1, 'P2', V2,... | Property name/property value pairs for the created job object; can be name/value pairs or structures. |
Job = dfevalasync(F, numArgOut, x1,...,xn, 'P1',V1,'P2',V2,...) is equivalent to dfeval, except that it runs asynchronously (async), returning to the prompt immediately with a single output argument containing the job object that it has created and sent to the cluster. You have immediate access to the job object before the job is completed. You can use waitForState to determine when the job is completed, and getAllOutputArguments to retrieve your results.
Job = dfevalasync(F, numArgOut, x1,...,xn, ... 'configuration', 'ConfigurationName',...) evaluates the function F in a cluster by using all the properties defined in the configuration ConfigurationName. The configuration settings are used to find and initialize a scheduler, create a job, and create tasks. For details about defining and applying configurations, see Programming with User Configurations. Configurations enable you to use dfevalasync with any type of scheduler.
For further discussion on the usage of dfevalasync, see Evaluating Functions Asynchronously.
Execute a sum function distributed in three tasks.
job = dfevalasync(@sum,1,{[1,2],[3,4],[5,6]}, ...
'jobmanager','MyJobManager');
When the job is finished, you can obtain the results associated with the job.
waitForState(job);
data = getAllOutputArguments(job)
data =
[ 3]
[ 7]
[11]
data is an M-by-numArgOut cell array, where M is the number of tasks.
dfeval, feval, getAllOutputArguments, waitForState
![]() | dfeval | diary | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |