... processes2.1
Most of the time we will talk about processes rather than processors, but the assumption is that the different processes may be running on different processors to achieve a parallel speedup.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... arrays2.2
It is arguable that this is one of the places where High Performance Fortran went wrong. HPF tries to make distributed arrays semantically indistinguishable from the sequential arrays of the base language (Fortran). This means on the one hand that distributed arrays have to allow the same kind of unlimiteid random access as sequential arrays, which is difficult and inefficient to support. On the other hand, there are places where it is difficult to be sure at compile-time whether a subprogram will be dealing with a sequential array or a distributed array. The compiler may have to make a worst case assumption, leading to inefficiencies in treatment of sequential arrays.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... grid2.3
Unless they are collapsed; see section 3.3.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... triplet2.4
The syntax for triplets is lifted directly from Fortran 90.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... arrays2.5
Many of them are modelled on the array transformational intrinsic functions of Fortran 90.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... them2.6
Because stencil updates are so common, we will see in section 3.2 that, as a special case, the language does allow constantly shifted locations as subscripts. But exploiting this facility needs some special provisions.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... method2.7
Maybe we could have chosen a more creative first example. But the point is to explain language features--the more familiar the algorithm, the better.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... algebra3.1
Notably ScaLAPACK.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... extensions3.2
We need to be rather clear about the semantics of this extension, because it is an odd case. Suppose x is the range associated with the bound location i. Let j be the location x [i` + e]. If j is mapped to the same processes as i, and i + e is used as a subscript, it behaves just like the true location j. If j is mapped to a different set of processes from i, and i + e is used as a subscript, the resulting reference must be to an element in a ghost region on the process holding i.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... section4.1
The HPJava idea of an array section expression has a close relationship to the Fortran 90 idea of an array pointer. In Fortran an array pointer can reference an arbitrary regular section of an array
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... operation4.2
Choice of an arithmetic operator rather than a subscripting notation for group restriction is not ad hoc. A subscripting notation would require information about the position of a particular process dimension in the list of dimensions of the group. Experience shows that this positional information is often not fixed ``statically''--the dimension may vary from invocation to invocation of a piece of code.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... subscript4.3
Use of ranges as section subscripts was not mentioned before because it is not very useful in practise. It is allowed, for symmetry with integer and location subscripts.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... indiscriminately4.4
It also allows HPJava arrays to reproduce the full panoply of alignment options supported by the ALIGN directive of High Performance Fortran.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... ranges4.5
Later we will give more detailed definitions.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... p5.1
Alternatively x can be a collapsed range, in which case p / i is defined to be equal to p.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... construct5.2
Technically this nesting is legal (but pointless) if x is collapsed.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... )5.3
This last statement needs some interpretation, because locations in certain ranges may be identified with locations in others. For example, locations in a subrange will be identified with the matching locations of the parent range. In fact it is possible for two independently created ranges to be considered ``aligned'', in which case their locations will be identified. In general this will happen if the two ranges are are distributed over exactly the same process dimension and they have sufficiently similar distribution formats. ``Sufficiently similar'' usually means the distribution formats should be structurally identical, but their is even some leeway here. In particular locations in an ExtBlockRange can be identified with the corresponding locations of a BlockRange if the ranges have the same extent and process dimension. The Range class has includes methods such as isAligned that can be used to determine if two ranges are aligned, and thus logically share locations.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... coherent5.4
Actually there is a short example in section 2.1 that uses crd inquiry, and therefore isn't canonical.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... shape6.1
The shape of a distributed array is the list of its extents, (a.rng(0).size(), a.rng(1).size(), ...).
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.