codistributor2dbc.defaultLabGrid
Default computational grid for 2-D block-cyclic distributed arrays
Syntax
grid = codistributor2dbc.defaultLabGrid()
Description
grid = codistributor2dbc.defaultLabGrid()
returns a vector,
grid = [nrow ncol]
, defining a computational grid of
nrow
-by-ncol
workers in the open parallel
pool, such that spmdSize
= nrow
x
ncol
.
The grid defined by codistributor2dbc.defaultLabGrid
is as
close to a square as possible. The following rules define nrow
and ncol
:
If
spmdSize
is a perfect square,nrow = ncol = sqrt(spmdSize)
.If
spmdSize
is an odd power of 2, thennrow = ncol/2 = sqrt(spmdSize/2)
.nrow <= ncol
.If
spmdSize
is a prime,nrow = 1
,ncol = spmdSize
.nrow
is the greatest integer less than or equal tosqrt(spmdSize)
for whichncol = spmdSize/nrow
is also an integer.
Examples
View the computational grid layout of the default distribution scheme for the open parallel pool.
spmd grid = codistributor2dbc.defaultLabGrid end