![]() |
The HPJava Project |
||
|
|||
![]()
![]() ![]() ![]() |
Accessing array elementsThe mechanism for subscripting distributed arrays in HPJava is complicated by the fact that only local elements are supposed to be directly accessible. One cannot simply use a global integer subscript in a distributed dimension of an array, because in general that might refer to an element held by some other process.The language incorporates a special syntactic entity called a location. A location is a particular element of a particular distributed range. The nth location (starting from zero) of range x is designated x[n]. In a normal subscripting operation, any subscript in a distributed dimension of an array must be a location in the range associated with that dimension of the array. This constraint alone doesn't guarantee that the location (and thus array element) is locally resident. To ensure this, we insist that the location used as a subscript must be a named subscript scoped by an at or overall construct.
In
Locations have a peculiar status in the language. They can only be named through overall or at constructs. This implies that location values cannot be stored in ordinary Java variables or passed as arguments to user-defined methods. It is sometimes convenient to regard locations as having class Location, but really they live somewhere outside the normal type system - essentially a symbolic convenience. Locations are not ``first class'' entities of the language. Their status is comparable with, say, the FORALL indices, or the alignment dummies, of HPF. Next: Subgroups |