codistributor2dbc.defaultWorkerGrid
Default computational grid for 2-D block-cyclic distributed arrays
Description
returns a vector defining a computational grid of grid = codistributor2dbc.defaultWorkerGridnrow-by-ncol workers
such that the product is the number of workers running in the current spmd block or communicating job. To get the number of workers running in the
current spmd block, use the spmdSize
function. The grid defined by codistributor2dbc.defaultWorkerGrid is as
close to a square as possible. The following rules define the nrow and
ncol of the grid:
If the number of workers running in the current
spmdblock is a perfect square,nrow = ncol = sqrt(.spmdSize)If the number of workers running in the current
spmdblock is an odd power of 2, thennrow = ncol/2 = sqrt(.spmdSize/2)nrow <= ncol.If the number of workers running in the current
spmdblock is a prime number,nrow = 1,ncol =.spmdSizenrowis the greatest integer less than or equal tosqrt(for whichspmdSize)ncol =is also an integer.spmdSize/nrow