Figure 4 gives a schema for translating
a distributed array declaration in the source HPJava program.
Here
is some Java type,
,
and
are new identifiers, typically derived from
by adding some suffixes,
the strings
are each either
a hyphen, -, or an asterisk, *, and the ``macro''
DIMENSION_TYPE is defined as
If, for example, a class in the source program has a field:
In general a rank-
distributed array in the source program is
converted to
variables in the translated program.
The first variable is an ordinary, one-dimensional, Java array holding
local elements. A simple ``struct''-like object of type ArrayBase
contains a base offset in this array and an HPJava Group object
(the distribution group of the array).
further simple objects of
type ArrayDim each contain an integer stride in the local array
and an HPJava Range object describing the dimensions of the
distributed array. The class SeqArrayDim is a subclass of ArrayDim, specialized to parameterize sequential dimensions
conveniently.
One thing to note is that a class file generated by compiling the
translated code will contain the generated field names.
These follow a fixed prescription, so that when a pre-compiled class
file (from some library package, say) is read by the HPJava translator,
it can reconstruct the original distributed array signature of the
field from the
fields in the class file. It can then correctly
check usage of the external class. By design, the translator can
always reconstruct the HPspmd class signatures from the standard Java
class file of the translated code.