defaultPartition - Default partition for codistributed array

Syntax

P = defaultPartition(n)

Description

P = 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,

P>> P = defaultPartition(10)
  1: P =
  1:      3     3     2     2
  2: P =
  2:      3     3     2     2
  3: P =
  3:      3     3     2     2
  4: P =
  4:      3     3     2     2

See Also

codistributor, codcolon, codistributed, distributionPartition

  


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