defaultPartition - Default partition for distributed 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 distributed 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

distributor, dcolon, distributed, distributionPartition

  


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