User`s guide
5 Math with Codistributed Arrays
5-10
Constructor Functions
The codistributed constructor functions are listed here. Use the codist argument
(created by the codistributor function: codist=codistributor()) to specify over
which dimension to distribute the array. See the individual reference pages for these
functions for further syntax and usage information.
eye(___,codist)
false(___,codist)
Inf(___,codist)
NaN(___,codist)
ones(___,codist)
rand(___,codist)
randi(___,codist)
randn(___,codist)
true(___,codist)
zeros(___,codist)
codistributed.cell(m,n,...,codist)
codistributed.colon(a,d,b)
codistributed.linspace(m,n,...,codist)
codistributed.logspace(m,n,...,codist)
sparse(m,n,codist)
codistributed.speye(m,...,codist)
codistributed.sprand(m,n,density,codist)
codistributed.sprandn(m,n,density,codist)
Local Arrays
That part of a codistributed array that resides on each worker is a piece of a larger array.
Each worker can work on its own segment of the common array, or it can make a copy of
that segment in a variant or private array of its own. This local copy of a codistributed
array segment is called a local array.
Creating Local Arrays from a Codistributed Array
The getLocalPart function copies the segments of a codistributed array to a separate
variant array. This example makes a local copy L of each segment of codistributed array
D. The size of L shows that it contains only the local part of D for each worker. Suppose
you distribute an array across four workers:
spmd(4)
A = [1:80; 81:160; 161:240];
D = codistributed(A);