| Parallel Computing Toolbox™ | ![]() |
D = distributed(L)
D = distributed(L, dist)
D = distributed(L, D1)
D = distributed(X, 'convert')
D = distributed(X, dist, 'convert')
D = distributed(X, dist, lab, 'convert')
D = distributed(L) forms a distributed array with localPart(D) = L. The distributed array D is created as if you had concatenated all the local L's together. The distribution scheme of D is specified by the default distributor object.
D = distributed(L, dist) forms a distributed array with the distribution scheme specified by dist.
D = distributed(L, D1) forms a distributed array with the same distribution scheme as that of distributed array D1.
D = distributed(X, 'convert') distributes a replicated X using the default distributor. X must be a replicated array, that is, it must have the same value on all labs. size(D) is the same as size(X).
D = distributed(X, dist, 'convert') distributes a replicated X using the distributor dist. X must be a replicated array, namely it must have the same value on all labs. size(D) is the same as size(X).
D = distributed(X, dist, lab, 'convert') distributes a local array X that resides on the lab identified by lab, using the distributor dist. size(D) is the same as size(X).
gather essentially performs the inverse of distributed(...'convert).
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.
distributor, defaultPartition, gather
![]() | diary | distributionDimension | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |