gplus
(Not recommended) Add arrays from workers in an spmd
block
gplus
is not recommended. Use spmdPlus
instead. For more information, see Version History.
Description
add the
arrays C
= gplus(A
)A
stored on each 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
gplus
on these workers, then C
is equal to
A
.
The function gplus
adds the arrays when A
has
a compatible size on each worker.
If numlabs
is equal to 1
, C
is equal to A
. numlabs
is equal to
1
outside of an spmd
block or communicating
job.
computes the sum of the arrays and stores the result on only one worker. On the worker with
C
= gplus(A
,destination
)labindex
equal to destination
,
C
is equal to the sum. On all other workers, C
is []
.
Examples
Input Arguments
Algorithms
When you use gplus(A)
, the value of A
on each
worker is added to the value on other workers.