labSendReceive
(Not recommended) Simultaneously send and receive data on a worker in an
spmd
block
labSendReceive
is not recommended. Use spmdSendReceive
instead. For more information, see Version History.
Description
B = labSendReceive(
sends data from the current worker in an destination
,source
,A
)spmd
block or communicating job
to a destination
, and receives data from a source
.
The array A
is sent from the current worker to the worker with
labindex
is equal to
destination
. The current worker receives data from the worker with
labindex
equal to source
.
When a worker runs labSendReceive(destination,source,A)
the
computation is equivalent to the worker running the following code, but the send and receive
can proceed
simultaneously:
labSend(A,destination); B = labReceive(source);
B = labSendReceive(___,
sends
and receives data with the tag tag
)tag
. When you use
labSendReceive
to send data between workers, multiple items of data
can wait to be collected. When you send multiple items of data to a worker, add a tag to
each item to distinguish between the items.