Next: Changes for ghost regions
Up: Some Rules and Definitions
Previous: Rules for distributed array
Contents
Index
Rules for access to distributed array elements
First we will collect together rules for distributed array element
references implied or informally stated in 2.5 and
subsequent sections. The first rule is part of the static semantics
of the language--it can be enforced by the type checker:
Rule 4
If

is a distributed array, then in the element reference
the expression

is either an integer expression--allowed only if
the corresponding dimension of

has the sequential attribute--or a
(possibly shifted) distributed index.
Depending on whether
is in fact an integer, an index
declared in an at construct, or an index declared in an overall
construct, exactly one of the following three ``run-time''5.3rules applies. To simplify the discussion, we first ignore ghost regions.
The three rules are: either
Rule 5
In the distributed array element reference:
if

is an integer, its value must lie in the range
where

.
or
Rule 6
The distributed array element reference in:
is allowed if and only if
- The expression
is invariant in the at construct5.4.
- The location
is an element of the range
5.5.
or
Rule 7
The distributed array element reference in:
is allowed if and only if
- The expression
is invariant in the overall construct.
- All locations in
are of elements
.
A subtle point to appreciate is that rules
6 and 7 are statements
about the at and overall constructs as a whole, not about
the array accesses
in isolation. They apply unconditionally to any access that appears
textually inside the constructs, even if some conditional test in the
body of the construct might prevent those accesses from actually being
executed. This is potentially important because it allows any associated
run-time checking code to be lifted outside the constructs, and in
particular to be lifted outside the local loops implied by an overall.
We should point out that the run-time rules given in this section and
the following subsection are
not checked by the HPJava compiler in the hpjdk 1.0 release.
This is a shortcoming that we hope will be rectified in future releases.
Subsections
Next: Changes for ghost regions
Up: Some Rules and Definitions
Previous: Rules for distributed array
Contents
Index
Bryan Carpenter
2003-04-15