spmdProbe
Syntax
Description
tf = spmdProbe
tests whether data is available to the current
worker in an spmd
block or communicating job. If it is 1,
the worker can receive the data using spmdReceive
.
When you offload computations using parfor
and
parfeval
, only one worker at a time runs each computation. These
workers are independent and do not communicate with each other. If you apply
spmdProbe
to these workers, the function has no effect.
If the data is available, spmdProbe
returns a logical
1
(true
). Otherwise, spmdProbe
returns a logical 0
(false
).
To use spmdProbe
, the number of workers running the current
spmd
block must be greater than 1
.
tf = spmdProbe(
tests whether data is
available for the current worker to receive from the worker whose index is equal to
source
)source
.
tf = spmdProbe('any')
tests whether the sent data is available for
the current worker to receive from any worker.
tf = spmdProbe('any',
tests whether data
sent with the tag tag
)tag
is available for the current worker to receive
from any worker.
[tf,
tests whether data is available for the current worker to receive, returns the index of the
worker that is sending data as sourceOut
,tagOut
] = spmdProbe(___)sourceOut
, and returns the tag of
available data as tagOut
. If multiple items of data are available,
spmdProbe
returns the index and tag of the first matching
message.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2022b