next up previous contents
Next: Translation of element access Up: Basic Translation Scheme Previous: Translation of the at   Contents


Translation of the overall construct

Figure 4.13 represents a schema for translating 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. $ {\bf T}\left[{e}\right]$ represents the translated form of expression $ e$. The local subscript for the index $ i$ is the value of sub. This value is used in subscripting multiarrays. The global index for the index $ i$ is the value of glb. This value is used in evaluating the global index expression $ i\verb$\lq $$. Since we use the localBlock() method to compute parameters of the local loop, this translation is identical for every distribution format--block-distribution, simple-cyclic distribution, aligned subranges, and so on -- supported by the language. Of course there is an overhead related to abstracting this local-block parameter 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.

Figure 4.14: Translation of multiarray element access.

SOURCE:
$\displaystyle e$ $\displaystyle \equiv$ $\displaystyle a \verb$ [$ e_0 \verb$, $ \ldots \verb$, $ e_{R-1} \verb$]$$  

TRANSLATION:
$\displaystyle {\bf T}\left[{e}\right]$ $\displaystyle \equiv$  

where:

\begin{displaymath}
\begin{array}{l}
\mbox{The expression $a$\ is the subscrip...
...{the macro {\it OFFSET} is defined in the text.}
\end{array}
\end{displaymath}



next up previous contents
Next: Translation of element access Up: Basic Translation Scheme Previous: Translation of the at   Contents
Bryan Carpenter 2004-06-09