Default partition for codistributed array
P = codistributor1d.defaultPartition(n)
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.
If numlabs = 4
, the following code returns
the vector [3 3 2 2]
on all workers:
spmd P = codistributor1d.defaultPartition(10) end