parfevalOnAll
所有工人在异步执行函数parallel pool
Description
requests the asynchronous execution of the functionF
= parfevalOnAll(p
,fcn
,numout
,in1,in2,...
)fcn
on all workers in the parallel poolp
.parfevalOnAll
evaluatesfcn
on each worker with input argumentsin1
,in2
,..., and expectsnumout
output arguments.F
is aFuture
object, from which you can obtain the results when all workers have completed executingfcn
.
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
UseparfevalOnAll
instead ofparfor
orspmd
if you want to useclear
. This preserves workspace transparency. SeeEnsure Transparency in parfor-Loops or spmd Statements.