Next: Restricted Groups Up: Distributed Array Sections Previous: Matrix multiplication with reduced   Contents   Index

# Subranges

Let's take another look at the example of the array section in figure 4.2. We can capture this section in a named variable as follows

Now, what are the ranges of c--the objects returned by the rng() inquiry applied to c?

In fact they are a different sort of range from any considered so far--they are subranges. For completeness the HPJava language provides a special syntax for constructing subranges directly. Ranges equivalent to those of c can be created by

This syntax should look quite natural. It is modelled on the syntax for multiarray sections themselves.

The global indices associated with the subrange , for example, are in the range . A subrange inherits locations from its parent range, but it specifically does not inherit global indices from the parent.

A non-trivial subrange is one for which the lower bound is not equal to zero, or the upper bound is not equal to , or the stride is not equal to 1.

A non-trivial subrange is never considered to have ghost extensions, even if its parent range does. This avoids various ambiguities that might otherwise crop up.

That covers the distributed ranges of sections. What about the distribution groups of sections? Now triplet subscripts don't cause problems--the distribution group of c above can be defined to be the same as the distribution group of the parent distributed array a. But the example of figure 4.1 is problematic. This was constructed using a scalar subscript, effectively as follows:

The single range of b is clearly y, but identifying the distribution group of b with that of a doesn't seem to be right. If a one dimensional array is newly constructed with range y and distribution group p, like this:

it is understood to be replicated over the first dimension of p. The section b clearly isn't replicated in this way. Where does the information that b is localized to the top row of processes go?

Next: Restricted Groups Up: Distributed Array Sections Previous: Matrix multiplication with reduced   Contents   Index
Bryan Carpenter 2003-04-15