labReceive
(Not recommended) Receive data from another worker in an spmd
block
labReceive
is not recommended. Use spmdReceive
instead. For more information, see Version History.
Syntax
Description
B = labReceive
receives data sent from any worker in the current
spmd
block or communicating job.
Tip
When you offload computations using parfor
and
parfeval
, each computation is run by only one worker at a time.
These workers are independent and do not communicate with each other. If you use
labReceive
on these workers, the function has no effect.
When a worker runs labReceive
, execution of other commands is
blocked until the worker receives the data.
To use labReceive
, numlabs
must be greater than
1
.
B = labReceive(
receives data sent from
the worker with source
)labindex
equal to source
.
B = labReceive('any')
receives data from any worker.
B = labReceive('any',
receives data sent
with the tag tag
)tag
from any worker.