next up previous contents
Next: Effect and Restrictions Up: The Java Adlib API Previous: Effect and Restrictions   Contents

WriteHalo

A writeHalo() method is a collective communication operation used to fill the ghost cells or overlap regions surrounding the "physical" segment of a distributed array. The simplest versions have prototype

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\verb$ void writeHalo ($$T$\verb$  ...

where the variable $ T$ runs over all primitive types and Object, and the notation $ T$ # means a multiarray of arbitrary rank, with elements of type $ T$. More general forms of writeHalo allow to specify that only a subset of the available ghost area is to be updated, or to select circular wraparound for updating ghost cells at the extreme ends of the array:

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\verb$ void...
... ($$T$\verb$  ...

and

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\verb$ void...
... ...

Simplest form defines a schedule in which whole of the array ghost region is updated using Adlib.EDGE mode:

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\verb$ who ...
...ion()$\\
\verb$ mode [$\verb$r] = Adlib.EDGE$
\end{tabbing}
\end{minipage}
$

In general forms, the integer vectors wlo, whi, and mode have length $ R$, the rank of the argument source. The values wlo and whi specify the widths at upper and lower ends of the bands to be updated. The upper and lower widths in dimension $ r$ are given by wlo [$ r$] and whi [$ r$]. These values are non-negative, and can only be non-zero if array source actually has suitable ghost extensions in the dimension concerned. More specifically, if the array source was created using a range with ghost extensions wlo$ _{\mbox{act}}$, whi$ _{\mbox{act}}$ as its $ r$th dimension, ie
wlo$\displaystyle _{\mbox{act}}$ $\displaystyle =$ source.rng($\displaystyle r$   ).loExtension()  
whi$\displaystyle _{\mbox{act}}$ $\displaystyle =$ source.rng($\displaystyle r$   ).hiExtension()  

it is required that
whi [$\displaystyle r$] $\displaystyle \le$ whi$\displaystyle _{\mbox{act}}$  
wlo [$\displaystyle r$] $\displaystyle \le$ wlo$\displaystyle _{\mbox{act}}$  

The writeHalo method is implemented by a schedule object with HPspmd class WriteHalo$ T$. Each primitive type and Object has its own schedule class. This class has two constructors with arguments identical to the method above, and has one public method with no arguments called execute(), which executes the schedule. The effective public interface of the WriteHalo$ T$ class is

$\displaystyle \begin{minipage}[t]{\linewidth}\small\verb$ public class WriteHal...
...ublic void execute () { ... }$\\
\verb$ . . .$\\
\verb$ }$
\end{minipage}
$

The source array is the source. In the second form the values wlo and whi specify the widths at upper and lower ends of the bands to be updated. The flag mode specifies the type of shift. It takes one of the values Adlib.CYCL, Adlib.EDGE, or Adlib.NONE.

Subsections
next up previous contents
Next: Effect and Restrictions Up: The Java Adlib API Previous: Effect and Restrictions   Contents
Bryan Carpenter 2004-06-09