spmdPlus
Description
add the
arrays C = spmdPlus(A)A stored on each worker in the current spmd block or communicating job and stores the result C
on all the workers.
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
spmdPlus to these workers, the function has no effect.
You can use spmdPlus only when A has a
compatible size on each worker.
If source is equal to the worker index, C is
equal to A.
adds the arrays and stores the result on only one worker. On the worker whose index is equal
to C = spmdPlus(A,destination)destination, C is equal to the sum. On all
other workers, C is []. To get the worker index, use
the spmdIndex
function.
Examples
Input Arguments
Output Arguments
Algorithms
This figure shows how the spmdCat function adds
A to the value on other workers when you call
spmdPlus(A).

Extended Capabilities
Version History
Introduced in R2022b