next up previous contents index
Next: Mapping of distributed array Up: Distributed Array Sections Previous: Subranges   Contents   Index

Restricted Groups

In the last section triplet section subscripts motivated us to define subranges as a new kind of range. Likewise, scalar section subscripts drive us to define a new kind of group. A restricted group is defined to be the subset of processes in some parent group to which a particular location is mapped. In the current example, the distribution group of b is defined to be the subset of processes in p to which the location x[0] is mapped. The division operator is overloaded to describe these subgroups, The distribution group of b is equivalent to q, defined by

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\small\begin{verbatim}Group q = p / x [0] ;\end{verbatim}\end{minipage}\end{displaymath}

The expression in the initializer is called a group restriction operation.

In a sense the definition of a restricted group was tacit in the definition of an abstract location. Without formally defining the idea, we used it implicitly in section 2.5. In Figure 2.7 of that section the set of processes with coordinates $(0,0)$, $(0,1)$ and $(0,2)$, to which location x[1] is mapped, can be written as

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\small\begin{verbatim}p / x [1]\end{verbatim}\end{minipage}\end{displaymath}

and the set with coordinates $(0,1)$ and $(1,1)$, to which y[4] is mapped, can be written as

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\small\begin{verbatim}p / y [4]\end{verbatim}\end{minipage}\end{displaymath}

The intersection of these two--the group containing the single process with coordinates $(0,1)$--can be written as

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\small\begin{verbatim}p / x [1] / y [4]\end{verbatim}\end{minipage}\end{displaymath}

or as

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\small\begin{verbatim}p / y [4] / x [1]\end{verbatim}\end{minipage}\end{displaymath}

The restricted groups introduced here have a simple concrete representation. A restricted group can be specified by its set of effective process dimensions and the identity of the lead process in the group--the process with coordinate zero relative to the dimensions effective in the group. The dimension set can be specified as a subset of the dimensions of the parent grid using a simple bitmask. The identity of the lead process can be specified through a single integer ranking the processes of the parent grid. So a general HPJava group can be parametrized by a reference to the parent Procs object, plus just two int fields. It turns out that this representation is not only compact; it also lends itself to efficient computation of the most commonly used operations on groups.

Notice by the way that the inquiry function dim() is a member of the Procs class (the process grid class), not the superclass Group, which also embraces restricted groups.


next up previous contents index
Next: Mapping of distributed array Up: Distributed Array Sections Previous: Subranges   Contents   Index
Bryan Carpenter 2003-04-15