In this section we mention two usage guidelines which have some relationship to the usage rules of the previous sections, but which are not required to make a legal HPJava program, and are not checked by the translator.
The first relates to a coherence property of variables. Informally, we will call a variable coherent if, at corresponding stages of execution of an SPMD program, processes belonging to the variable's home group always hold identical values in their local copies of the variable. If the home group of a variable is a single process, the variable is trivially coherent.
Giving a precise formal definition of coherence is quite difficult, because it is difficult to define formally what is meant by ``corresponding stages of execution''. What we can give is a precise rule which will keep all variables in a program coherent. This rule, which looks similar to usage Rule 3, is
It is often required that scalar arguments of collective operations
should be coherent. There is another common requirement for arguments
of collective operations--namely that all copies of all elements of
distributed array arguments should be held in the group of processes
that collectively invoke the operation. We will say that a distributed
array
is fully contained (in the active process group) if
. Therefore a natural
requirement is
ASSERT(apg.contains(a.grp())) ;
should appear inside the implementation of collective library functions,
as required.