redistribute

Redistribute a distributed array with another distribution scheme

Syntax

D2 = redistribute(D1)
D2 = redistribute(D1, D3)
D2 = redistribute(D1, dist)

Description

D2 = redistribute(D1) redistributes a distributed array D1 with the default distribution scheme. The distribution dimension dim is the last nonsingleton dimension and the partition is that specified by defaultPartition(size(D1,dim)) along the size of D1 in the distribution dimension.

D2 = redistribute(D1, D3) redistributes a distributed array D1 using the same distribution scheme as used for array D3.

D2 = redistribute(D1, dist) redistributes a distributed array D1 using the distribution scheme defined by the distributor object dist.

Examples

Redistribute an array according to the distribution of another array. First, create a magic square distributed by columns.

M = distributed(magic(10), distributor('1d', 2, [1 2 3 4]), 'convert');

Create a pascal matrix distributed by rows (first dimension).

P = distributed(pascal(10), distributor('1d',1), 'convert');

Redistribute the pascal matrix according to the distribution (partition) scheme of the magic square.

R = redistribute(P, M);

See Also

defaultPartition, distributed, distributionDimension, distributionPartition, distributor

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS