Skip to Main Content Skip to Search
Product Documentation

getCodistributor - Codistributor object for existing codistributed array

Syntax

codist = getCodistributor(D)

Description

codist = getCodistributor(D) returns the codistributor object of codistributed array D. Properties of the object are Dimension and Partition for 1-D distribution; and BlockSize, LabGrid, and Orientation for 2-D block cyclic distribution. For any one codistributed array, getCodistributor returns the same values on all labs. The returned codistributor object is complete, and therefore suitable as an input argument for codistributed.build.

Examples

Get the codistributor object for a 1-D codistributed array that uses default distribution on 4 labs:

spmd (4)
    I1 = codistributed.eye(64, codistributor1d());
    codist1 = getCodistributor(I1)
    dim = codist1.Dimension
    partn = codist1.Partition
end

Get the codistributor object for a 2-D block cyclic codistributed array that uses default distribution on 4 labs:

spmd (4)
    I2 = codistributed.eye(128, codistributor2dbc());
    codist2 = getCodistributor(I2)
    blocksz = codist2.BlockSize
    partn = codist2.LabGrid
    ornt = codist2.Orientation
end

Demonstrate that these codistributor objects are complete:

spmd (4)
    isComplete(codist1)
    isComplete(codist2)
end

See Also

codistributed | codistributed.build | getLocalPart | redistribute

  


Free Parallel Computing Interactive Kit

See how to solve large problems with minimal effort and reduce simulation time.

Get free kit

Trials Available

Try the latest versions of parallel computing products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS