Main Content
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) = spmdSize
. The first rem(n,spmdSize)
elements of P
are equal to ceil(n/spmdSize)
and the remaining elements are equal to floor(n/spmdSize)
. This function is the basis for the default distribution of codistributed arrays.
Examples
If spmdSize = 4
, the following code returns the vector [3 3 2 2]
on all workers:
spmd P = codistributor1d.defaultPartition(10) end
Version History
Introduced in R2009b