Execute function asynchronously on all workers in parallel pool
requests the asynchronous execution of the function F
= parfevalOnAll(p
,fcn
,numout
,in1,in2,...
)fcn
on all workers in
the parallel pool p
. parfevalOnAll
evaluates
fcn
on each worker with input arguments
in1
,in2
,..., and expects
numout
output arguments. F
is a parallel.FevalOnAllFuture object, from which
you can obtain the results when all workers have completed executing
fcn
.
requests asynchronous execution on all workers in the current parallel pool. If no pool
exists, it starts a new parallel pool, unless your parallel preferences disable automatic
creation of pools.F
= parfevalOnAll(fcn
,numout
,in1,in2,...
)
Note
Use parfevalOnAll
instead of
parfor
or spmd
if you want to use clear
. This preserves workspace transparency. See Ensure Transparency in parfor-Loops or spmd Statements.
cancel
| fetchNext
| fetchOutputs
| parallel.pool.Constant
| parfeval
| parpool
| wait