spmdCat
Concatenate arrays on spmd
workers
Description
horizontally concatenates the array B
= spmdCat(A
)A
defined on each worker running an
spmd
block or communicating job.
When you use parfor
, parfeval
, or
parfevalOnAll
to run code on a parallel
pool, the workers are independent and do not communicate with each other. If you use
spmdCat
on these workers, the result is the same as using
spmdCat
on a client.
You can use spmdCat
only if A
can be
concatenated along the second dimension.
This functions concatenates the arrays along the second dimension, then stores the
result on all the workers. The function takes the value of A
from each
worker and concatenates the results in order of the worker index. To get the function of a
worker, use the spmdIndex
function. For example,
spmdCat(spmdIndex)
returns 1:spmdSize
, where
spmdSize
is
the number of workers running the current spmd block or communicating job.
If one worker is running the current spmd
block,
B
is equal to A
.
concatenates B
= spmdCat(A
,dim
,destination
)A
and stores the result on only one worker.
Examples
Input Arguments
Output Arguments
Algorithms
This figure shows how the spmdCat
function concatenates
A
with the value on other workers when you call
spmdCat(A)
.
Extended Capabilities
Version History
Introduced in R2022b
See Also
cat
| spmdReduce
| spmdIndex
| spmdSize