blacs_init()
is for experienced users only. It is a shallow
wrapper of the BLACS routine BLACS_INIT
, with the addition of
creating the .__blacs_gridinfo_ICTXT
objects, as described below.
The remainder of this section applies only to init.grid()
.
If ICTXT
is missing, three variables will be created in the
.pbdBASEEnv
environment:
.__blacs_gridinfo_0
.__blacs_gridinfo_1
.__blacs_gridinfo_2
These variables store the BLACS process grid information for the BLACS
context corresponding to the trailing digit of the variable. Most users
should invoke init.grid()
in this fashion, namely with ICTXT missing,
and only do so once.
Contexts 0, 1, and 2 are reserved. Additional custom contexts are possible
to create, but they must be integers >= 3.
Context 0 is the ``full'' process grid of NPROW
by NPCOL
processes; contexts 1 is the process grid consisting of 1 process row and
NPROW
*NPCOL
processes columns; context 2 is the process grid
consisting of NPROW
*NPCOL
processes rows and 1 process column.
These contexts can be redundant depending on the number of prcesses
available.
BLACS contexts have important internal use, and advanced users familiar with
ScaLAPACK might find some advantage in directly manipulating these process
grids. Most users should not need to directly manage BLACS contexts, in this
function or elsewhere.
If the NPROW
and NPCOL
values are missing, then a best process
grid will be chosen for the user based on the total available number of
processes. Here ``best'' means as close to a square grid as possible.
The variables .__blacs_gridinfo_ICTXT
are just storage mechanisms to
avoid needing to directly invoke the BLACS routine BLACS_GRIDINFO
.
Additionally, another variable is created in the .pbdBASEEnv
environment, namely .__blacs_initialized
. Its existence is to alert
finalize()
to shut down BLACS communicators, if necessary, to prevent
memory leaks.