| Parallel Computing Toolbox™ | ![]() |
dist = distributor()
dist = distributor('1d')
dist = distributor('1d', dim)
dist = distributor('1d', dim, part)
dist = distributor('2d')
dist = distributor('2d', lbgrid)
dist = distributor('2d', lbgrid, blksize)
dist = distributor('replicate')
dist = distributor(D)
There are two schemes for distributing arrays. The scheme denoted by the string '1d' distributes an array along a single specified subscript, the distribution dimension, in a noncyclic, partitioned manner. The scheme denoted by '2d', employed by the parallel matrix computation software ScaLAPACK, applies only to two-dimensional arrays, and varies both subscripts over a rectangular computational grid of labs in a blocked, cyclic manner. There is also a scheme for replicating arrays, denoted by the string argument 'replicate'.
dist = distributor(), with no arguments, returns a default distribution object with zero-valued or empty parameters, which can then be used as an argument to other distributor functions to indicate that the function is to create a distributed array with default distribution. For example,
Z = zeros(..., distributor()) R = randn(..., distributor())
dist = distributor('1d') is the same as A = distributor().
dist = distributor('1d', dim) also forms a distribution object with distributionDimension(dist) = dim and distributionPartition(dist) = defaultPartition.
dist = distributor('1d', dim, part) also forms a distribution object with distributionDimension(dist) = dim and distributionPartition(dist) = part.
dist = distributor('2d') forms a '2d' distribution object. For more information about '2d' distribution, see 2-Dimensional Distribution.
dist = distributor('2d', lbgrid) forms a '2d' distribution object with labGrid(dist) = lbgrid and blockSize(dist) = defaultBlockSize(numlabs).
dist = distributor('2d', lbgrid, blksize) forms a '2d' distribution object with labGrid(dist) = lbgrid and blockSize(dist) = blksize.
dist = distributor('replicate') forms a distribution object that replicates data on labs.
dist = distributor(D) returns the distribution object of distributed array D.
Create a 3-dimensional array with distribution dimension 2 (i.e., by columns) and partition scheme [1 2 1 2 ...].
if mod(labindex, 2)
L = rand(2,1,4)
else
L = rand(2,2,4)
end
A = distributed(L, distributor())On four labs, create a 20-by-5 array A distributed by rows (over its first dimension) with an even partition scheme.
L = magic(5) + labindex;
dim = 1;
A = distributed(L, distributor('1d', dim));The dim input to distributor is required here to override the default distribution dimension.
distributionDimension, distributed, localPart, distributionPartition, redistribute
![]() | distributionPartition | eye | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |