next up previous contents
Next: Test Suites Up: Translation of array sections Previous: Integer subscripts in sequential   Contents

Scalar subscripts in distributed dimensions

The scheme for translating array sections when scalar subscripts appear in some distributed dimension is illustrated in Figure 4.17. We add two new cases for the definition of the macro PROCESS_SUBSCRIPTS. If subs$ _s$ is the integer expression , and the $ s$th dimension of $ a$ is distributed, then

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\small\begin{tabbing}
$\mbo...
...\left(v, r, a, s+1\right)$\ \\
\end{tabbing}
\end{minipage}
\end{displaymath}

where $ x$ and $ l$ are the names of new temporaries, $ a'_s = {\bf T}_{s}\left[{a}\right]$, and . Otherwise, if subs$ _s$ is a distributed index $ i$ or a shifted index $ i \pm d$, then

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\small\begin{tabbing}
$\mbo...
...\left(v, r, a, s+1\right)$\ \\
\end{tabbing}
\end{minipage}
\end{displaymath}

where the macro OFFSET_DIM is defined in section 4.5.6 and dim is the dimension associated with $ i$.

Figure 4.17: Translation of array section allowing scalar subscripts in distributed dimensions.

SOURCE:

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
$v$\verb$ = $$a$\verb$ [[$$$subs$\displaystyle _0 \verb$, $ \ldots \verb$, $$subs$\displaystyle _{R-1}$\verb$]] ;$
\end{tabbing}
\end{minipage}
$

TRANSLATION:

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
$b$\verb$ =...
... = new ArrayBase($$p$\verb$, $$b$\verb$) ;$ \\
\end{tabbing}
\end{minipage}
$

where:




Bryan Carpenter 2004-06-09