next up previous contents
Next: Discussion Up: The HPspmd Programming Model Previous: Low Level SPMD Programming   Contents


Adlib for HPJava

One HPJava communication library is called Adlib [11]. This library is not supposed to have a uniquely special status so far as the HPJava language is concerned. Eventually HPJava bindings for other communication libraries will probably be needed. For example, the Adlib library does not provide the one-sided communication functionality of libraries like the Global Arrays toolkit [35]. It doesn't provide optimized numerical operations on distributed arrays like those in ScaLAPACK [4]. Moreover, it doesn't provide highly optimized collective operations for irregular patterns of array access, like those in CHAOS [16]. These libraries (and others) work with distributed arrays more or less similar in concept to HPJava distributed arrays. Bindings to these or functionally similar libraries might one day be made available for HPJava. All collective operations in Adlib are based on communication schedule objects. Each kind of operation has a related class of schedules. Specific instances of the schedules involving particular array data arrays and other parameters are constructed by the class constructors. The communications needed to effect the operation are initiated by executing a schedule object. A single schedule may be executed and reused many times if the same pattern of accesses is repeated. The effective cost of computations involved in constructing a schedule can be decreased in this way. This paradigm was championed in PARTI. There are three categories of collective operation in Adlib; regular communications, reduction operations, and irregular communications. It also provides a few I/O operations. The regular communication operations are remap(), writeHalo(), shift(), and cshift(). For example, The remap() method takes two distributed array arguments--a source array and a destination. These two arrays must have the same size and shape, but they can have any, unrelated, distribution formats. Let's see an example from the Adlib communication library. Remap is a communication schedule for copying the elements of one distributed array (or section) to another. The effect of the operation is to copy the values of the elements in the source array to the corresponding elements in the destination array, performing any communications necessary to do that. If the destination array has replicated mapping, the remap() operation will broadcast source values to all copies of the destination array elements. As currently implemented, we can summarize the available remap() signatures in the notation:

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\verb$ void...
...$$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$. Reduction operations take one or more distributed arrays as input. They combine the elements to produce one or more scalar values, or arrays of lower rank. Adlib provides a fairly large set of reduction operations, mimicking the reductions available as ``intrinsic functions'' in Fortran. The operations are maxval(), minval(), sum(), product(), dotProduct(), etc. Adlib has some support for irregular communications in the form of collective gather() and scatter() operations. Moreover, the current HPJava version of Adlib has simple and rudimentary I/O functions such as aprintf() and gprintln().
next up previous contents
Next: Discussion Up: The HPspmd Programming Model Previous: Low Level SPMD Programming   Contents
Bryan Carpenter 2004-06-09