codistributor1d
1-D distribution scheme for codistributed array
Description
Use a codistributor1d
object to define the one-dimensional
distribution scheme for a codistributed array. The one-dimensional codistributor distributes
arrays along a single specified dimension, the distribution dimension, in a noncyclic,
partitioned manner.
Creation
Syntax
Description
returns a
codist
= codistributor1dcodistributor1d
object using the default dimension and partition. The
default dimension is the last nonsingleton dimension of the codistributed array. The
default partition distributes the array along the default dimension as evenly as
possible.
returns a 1-D codistributor object for distribution along the dimension specified by the
Dimension
property. For example, if codist
= codistributor1d(Dimension
)Dimension
is 1, the function distributes
the object along rows.
also returns a 1-D codistributor object for distribution according to the partition
vector specified by the Partition
property. For example, codist
= codistributor1d(Dimension
,Partition
)C1 = codistributor1d(1,[1,2,3,4])
distributes
an array of 10 rows to four workers, with one row to the first worker, two rows to the
second worker, three rows to the third worker, and four rows to the fourth
worker.
The resulting codistributor of any of the above syntaxes is incomplete because its global size is not specified. Use a codistributor constructed this way as an argument to other functions as a template codistributor when creating codistributed arrays.
returns a codistributor object with the global size codist
= codistributor1d(Dimension
,Partition
,gsize
)gsize
.
You can use the resulting codistributor object to build a codistributed array from
its local parts with codistributed.build
. To use a default
dimension, specify codistributor1d.unsetDimension
for the Dimension
property; the function derives the distribution dimension from gsize
and selects the last nonsingleton dimension as the default dimension. Similarly, to use
a default partition, specify codistributor1d.unsetPartition
for the
Partition
property; the function derives the default partition from the global size and
distribution dimension.
The local part on worker workerIndex
of a codistributed array
using such a codistributor is of size gsize
in all dimensions
except dimension
, where the size is
part(workerIndex)
. The local part has the same class and attributes
as the overall codistributed array. The overall global array can be reconstructed by
concatenating the various local parts along dimension
dimension
.
Input Arguments
Properties
Object Functions
codistributed.cell | Create codistributed cell array |
codistributed.colon | Distributed colon operation |
codistributed.spalloc | Allocate space for sparse codistributed matrix |
codistributed.speye | Create codistributed sparse identity matrix |
codistributed.sprand | Create codistributed sparse array of uniformly distributed pseudo-random values |
codistributed.sprandn | Create codistributed sparse array of normally distributed pseudo-random values |
eye | Create codistributed identity matrix |
false | Create codistributed array of logical 0 (false) |
globalIndices | Global indices for local part of codistributed array |
Inf | Create codistributed array of all Inf values |
isComplete | True if codistributor object is complete |
NaN | Create codistributed array of all NaN values |
ones | Create codistributed array of all ones |
rand | Create codistributed array of uniformly distributed random numbers |
randn | Create codistributed array of normally distributed random numbers |
sparse | Create codistributed sparse matrix |
true | Create codistributed array of logical 1 (true) |
zeros | Create codistributed array of all zeros |
Examples
Version History
Introduced in R2009b