next up previous
Next: Translating element access in Up: Basic translation scheme Previous: Translation of distributed arrays


Translation of the overall construct

Figure 5: Translation of overall construct.

SOURCE:

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb$overall...
...mbox{\small stp}}$\verb$) $$S$\ \\
\end{tabbing}\end{minipage}\end{displaymath}

TRANSLATION:


\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb$Block $...
...ert{p}\right.\right]$\ \\
\verb$}$
\end{tabbing}\end{minipage}\end{displaymath}

where:

\begin{displaymath}
\begin{array}{l}
\mbox{$i$\ is an index name in the source p...
...\ and $\mbox{\it glb}$ are names of new variables.}
\end{array}\end{displaymath}


The schema in Figure 5 describes basic translation of the overall construct. The localBlock() method on the Range class returns parameters of the locally held block of index values associated with a range. These parameters are returned in another simple ``struct''-like object of class Block. Terms like ${\bf T}\left[{e}\right]$ represent the translated form of expression $e$.

The local subscript for the index $i$ is the value of $\mbox{\it sub}$. This value is used in subscripting distributed arrays. The global index for the index $i$ is the value of $\mbox{\it glb}$. This value is used in evaluating the global index expression $i\verb$\lq $$.

Because we use the run-time inquiry function localBlock() to compute parameters of the local loop, this translation is identical for every distribution format supported by the language (block-distribution, simple-cyclic distribution, aligned subranges, and several others). Of course there is an overhead associated with abstracting this computation into a method call; but the method call is made at most once at the start of each loop, and we expect that in many cases optimizing translators will recognize repeat calls to these methods, or recognize the distribution format and inline the computations, reducing the overhead further.

${\bf T}\left[{S}\left\vert{p}\right.\right]$ means the translation of $S$ in the context of $p$ as active process group.


next up previous
Next: Translating element access in Up: Basic translation scheme Previous: Translation of distributed arrays
Bryan Carpenter 2002-07-12