... Machine1.1
In general, when a parallel HPJava program is run under the multithreaded model, the number of threads is determined by the value of the Java system property hpjava.numprocs. The default (if no -Dhpjava.numprocs option is given) is to run the program in a single thread.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... one1.2
This is not necessarily the case. As we will see shortly, a one-dimensional multiarray might be useful in an algorithm that worked on regular sections of a one-dimensional vector.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... itself1.3
A later version of HPJava may add an operation for directly obtaining the extent of the multiarray, and lift the restriction that the argument of these inquiries is a constant expressions.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... subscripts1.4
Unlike in Fortran, vector subscripts are not allowed in HPJava.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... array1.5
In fact not so notional; the translator reduces a multiarray to a flat Java array.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... grids2.1
Our use of the term ``grid'' isn't supposed to be confused with the same term as used by the Global Grid Forum. Perhaps it would be better to change the name, but ``process grid'' seems as natural as anything.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... on2.2
Or, more generally, if the requested number of processes is greater than the size of the current active process group, defined shortly.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... allowed2.3
In hpjdk 1.0 the highest Procs$D$ class is Procs3. But you can use a constructor of the base class Procs to create higher dimension grids if you actually need them.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... group2.4
Unless they are collapsed ranges; see section 3.3.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... arrays2.5
Many of them, by the way, modelled on the array transformational intrinsic functions of Fortran.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... version2.6
We plan to improve support for Windows in mpiJava 1.3.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... expression4.1
Distributed indices are allowed as well, if the location is in the proper range.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... discrimination4.2
It also allows HPJava arrays to reproduce the full panoply of alignment options supported by the ALIGN directive of High Performance Fortran.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... aligned4.3
Later we will give more detailed definitions.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...p5.1
Alternatively x can be a collapsed range, in which case $\mbox{\tt p} / \mbox{\tt i}$ is defined to be equal to p.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... construct5.2
Strictly speaking this nesting is legal (but pointless) if x is collapsed.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...5.3
Of course there is nothing to prevent a compiler applying these checks at compile-time if it can do so.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... construct5.4
The interpretation of ``invariant'' will be discussed in section A.2.1. Actually this condition is more important for the case of an index subscript declared by an overall (next rule). It is imposed here to preserve the relation between at and overall given in 2.5.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...5.5
This 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 includes methods such as isAligned() that can be used to determine if two ranges are aligned, and thus logically share locations.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... regions5.6
See section 7.3.1 for an example of a sequential dimension with ghost regions.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... initiated5.7
Because of the dynamic way Java classes are loaded and initialized, this definition is problematic. This may be another good reason for for avoiding static fields in HPJava programs.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... variable5.8
These statements shouldn't exactly be taken as rigorous theorems. They haven't been proven, and the language is sufficiently complex it is almost certain somebody can find awkward cases to disprove them. But the general idea feels right.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... coherent5.9
There is a short example in section 2.2 that uses the crd() inquiry, and therefore isn't canonical.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... Adlib6.1
The name, Adlib, is due to John Merlin.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... shape6.2
The shape of a multiarray or distributed array is the list of its extents, (a.rng(0).size(), a.rng(1).size(), ...).
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... mechanisms6.3
In a single call to a remap-like operation, a single ObjectOutputStream is used to serialize all objects sent from the local process to any given remote process. In the case where, say, two elements initially on the same process both hold references to a single object, and the two references are copied to different processes, referential integrity is explicitly not preserved--the copied references are to different, local copies of the original object. But this is normal for Java serialization.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... 36.4
This could be increased by adding extra stub methods to the Adlib class, but eventually the excessive number of methods on this class becomes an issues.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...7.1
In this case the dimension-split version of a is the same as the dimension-split version of the parent array b. An odd feature of a section with a dimension-splitting subscript is that the ``section'' may have more accessible elements than the parent array. This is a little counter-intuitive, and introduces some possibilities for abuse. But it is not a logically inconsistent situation, and, used carefully, it has various benefits.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...7.2
Note however that the size() inquiry applied to the associated collapsed range will still return the ``physical'' extent, $B$.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...7.3
This example actually assumes $x$ has alignment stride of 1. In general the displacement in the translation should be multiplied by $x\mbox{\tt .str()}$, where $x$ is the range parametrizing the original overall.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... dimension7.4
Note these ``memory'' bases and strides are distinct from the subrange alignment parameters returned by similarly named inquiries on ranges.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... these7.5
At least for subranges with positive alignment stride. We will return to this issue in section 7.6.3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... like7.6
The inquiry str() on Range returns the alignment stride of an arbitrary range. There is a related inquiry, bas(), that returns the alignment base. These alignment parameters of ranges are distinct from ``memory'' base and strides returned by the similarly-named inquiries on multiarrays.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... limitationA.1
Incidentally, Fortran 90 also does not allow arrays of arrays to be declared directly. If they are needed they have to be simulated by introducing a derived datatype wrapper, just as we introduced a class here.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... classesA.2
According to these rules it is allowed for a non-HPspmd code to hold a reference to a distributed array, although it is limited in what operations it can perform on the array. Also note that non-HPspmd code can manipulate sequential multiarrays unrestrictedly.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... signaturesA.3
We will use the term function to cover both methods and constructors.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...A.4
There is one situation in which a general array expression would cause a problem here, and that is expressions like (a = e).grp(). All components of the expression a = e have side effects, but the translation scheme of Figures A.39 and A.40 would cause some components of the expression to be improperly discarded. If preferred, this situation could be addressed by a more specific rule. [This should be changed. It's probably more natural to handle this by marking multiarray-valued assignment subexpressions as composite expressions.]
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...A.5
Exactly where $A$ is declared is not very important to the following discussion. It could be declared as a top-level class, but that would have the disadvantage of polluting the global name-space of classes. The current HPJava translator introduces $A$ as a private, static member class of the most closely lexically enclosing class of $C$ that is not an inner class. If $C$ is not an inner class, $A$ will be a member of $C$ itself.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... indexA.6
Although it is an odd case, there is nothing in the language definition to prevent one from declaring indexes in overall or at statements to belong to the collapsed range of a sequential array dimension, and then using the index as a subscript in that array dimension.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... typeA.7
It evaluates trivially to false, but it is allowed.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
... thenA.8
We already see a subtlety with null references. If $e$ is a null reference, then the resulting abstract multiarray ought to be interpretted as null. But here it involves an array of $R$ nulls. So the abstract multiarray resulting from two null arrays of different rank would have different structure, although both should presumably be interpretted as the null reference for abstract multiarrays.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.