Process grids¶
Th Grid
class is responsible for converting MPI communicators into
a twodimensional process grid meant for distributing matrices (ala the
soontobediscussed DistMatrix<T,U,V>
class).

class
Grid
¶ 
Grid
(mpi::Comm comm = mpi::COMM_WORLD)¶ Construct a process grid over the specified communicator and let Elemental decide the process grid dimensions. If no communicator is specified, mpi::COMM_WORLD is used.

Grid
(mpi::Comm comm, int height)¶ Construct a process grid over the specified communicator with the given height. Note that the size of the communicator must be divisible by height.
Simple interface (simpler version of distributionbased interface)

int
Row
() const¶ Return the index of the row of the process grid that this process lies in.

int
Col
() const¶ Return the index of the column of the process grid that this process lies in.

int
Rank
() const¶ Return our process’s rank in the grid. The result is equivalent to the
VCRank()
function described below, but this interface is provided for simplicity.

int
Height
() const¶ Return the height of the process grid.

int
Width
() const¶ Return the width of the process grid.

int
Size
() const¶ Return the number of active processes in the process grid. This number is equal to
Height()
\(\times\)Width()
.
Distributionbased interface

int
MCRank
() const¶ Return our process’s rank in the
MC
(Matrix Column) communicator. This corresponds to our row in the process grid.

int
MRRank
() const¶ Return our process’s rank in the
MR
(Matrix Row) communicator. This corresponds to our column in the process grid.

int
VCRank
() const¶ Return our process’s rank in the
VC
(Vector Column) communicator. This corresponds to our rank in a columnmajor ordering of the process grid.

int
VRRank
() const¶ Return our process’s rank in the
VR
(Vector Row) communicator. This corresponds to our rank in a rowmajor ordering of the process grid.

int
MCSize
() const¶ Return the size of the
MC
(Matrix Column) communicator, which is equivalent to the height of the process grid.

int
MRSize
() const¶ Return the size of the
MR
(Matrix Row) communicator, which is equivalent to the width of the process grid.

int
VCSize
() const¶ Return the size of the
VC
(Vector Column) communicator, which is equivalent to the size of the process grid.

int
VRSize
() const¶ Return the size of the
VR
(Vector Row) communicator, which is equivalent to the size of the process grid.

mpi::Comm
MCComm
() const¶ Return the
MC
(Matrix Column) communicator. This consists of the set of processes within our column of the grid (ordered toptobottom).

mpi::Comm
MRComm
() const¶ Return the
MR
(Matrix Row) communicator. This consists of the set of processes within our row of the grid (ordered lefttoright).

mpi::Comm
VCComm
() const¶ Return the
VC
(Vector Column) communicator. This consists of the entire set of processes in the grid, but ordered in a columnmajor fashion.

mpi::Comm
VRComm
() const¶ Return the
VR
(Vector Row) communicator. This consists of the entire set of processes in the grid, but ordered in a rowmajor fashion.
Advanced routines

Grid
(mpi::Comm viewingComm, mpi::Group owningGroup)¶ Construct a process grid where only a subset of the participating processes should actively participate in the process grid. In particular, viewingComm should consist of the set of all processes constructing this
Grid
instance, and owningGroup should define a subset of the processes in viewingComm. Elemental then chooses the grid dimensions. Most users should not call this routine, as this type of grid is only supported for a fewDistMatrix
types. The size of owningGroup must be divisible by height.

int
GCD
() const¶ Return the greatest common denominator of the height and width of the process grid.

int
LCM
() const¶ Return the lowest common multiple of the height and width of the process grid.

bool
InGrid
() const¶ Return whether or not our process is actively participating in the process grid.

int
OwningRank
() const¶ Return our process’s rank within the set of processes that are actively participating in the grid.

int
ViewingRank
() const¶ Return our process’s rank within the entire set of processes that constructed this grid.

int
VCToViewingMap
() const¶ Map the given columnmajor grid rank to the rank in the (potentially) larger set of processes which constructed the grid.

mpi::Group
OwningGroup
() const¶ Return the group of processes which is actively participating in the grid.

mpi::Comm
OwningComm
() const¶ Return the communicator for the set of processes actively participating in the grid. Note that this can only be valid if the calling process is an active member of the grid!

mpi::Comm
ViewingComm
() const¶ Return the communicator for the entire set of processes which constructed the grid.

int
DiagPath
() const¶ Return our unique diagonal index in an tesselation of the process grid.

int
DiagPath
(int vectorColRank) const¶ Return the unique diagonal index of the process with the given columnmajor vector rank in an tesselation of the process grid.

int
DiagPathRank
() const¶ Return our process’s rank out of the set of processes lying in our diagonal of the tesselation of the process grid.

int
DiagPathRank
(int vectorColRank) const¶ Return the rank of the given process out of the set of processes in its diagonal of the tesselation of the process grid.

Grid comparison functions