Skip to Main Content Skip to Search
Product Documentation

codistributor1d.defaultPartition - Default partition for codistributed array

Syntax

P = codistributor1d.defaultPartition(n)

Description

P = codistributor1d.defaultPartition(n) is a vector with sum(P) = n and length(P) = numlabs. The first rem(n,numlabs) elements of P are equal to ceil(n/numlabs) and the remaining elements are equal to floor(n/numlabs). This function is the basis for the default distribution of codistributed arrays.

Examples

If numlabs = 4, the following code returns the vector [3 3 2 2] on all labs:

spmd
    P = codistributor1d.defaultPartition(10)
end

See Also

codistributed | codistributed.colon | codistributor1d

  


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