distributed
Create distributed array from data in the client workspace or a datastore
Description
creates a distributed array from a D
= distributed(ds
)datastore
ds
. D
is a distributed array stored in parts on
the workers of the open parallel pool. You operate on the entire array as a single entity;
however, workers operate only on their part of the array and automatically transfer data
between themselves when necessary.
To retrieve the distributed array elements from the pool back to an array in the
MATLAB® workspace, use gather
.
creates a distributed array from an array D
= distributed(X
)X
.
Constructing a distributed array from local data this way is appropriate only if the
MATLAB client can store the entirety of X
in its memory. To construct
large distributed arrays, use the previous syntax to create a distributed
array from a datastore
, or use one of the array creation functions such
as
,
ones
(___,"distributed")
, etc.
For a list of functions that can create zeros
(___,"distributed")distributed
arrays directly,
see distributed
.
If the input argument is already a distributed array, the result is the same as the input.
creates a distributed array from a D
= distributed(C
,dim
)Composite
array
C
, with the entries of C
concatenated and
distributed along the dimension dim
. If you omit
dim
, then the first dimension is the distribution dimension.
All entries of the Composite
array must have the same class.
Dimensions other than the distribution dimension must match.
Examples
Input Arguments
Output Arguments
Tips
A distributed array is created on the workers of the existing parallel pool. If no pool exists,
distributed
starts a new parallel pool unless the automatic starting of pools is disabled in your parallel preferences. If there is no parallel pool anddistributed
cannot start one, MATLAB returns the result as a non-distributed array in the client workspace.
Version History
Introduced in R2008a