next up previous
Next: Data descriptor and global Up: Java language Binding Previous: Structured SPMD programming.

Global variables

When an SPMD program starts on a group of $n$ processes, there will be $n$ control threads mapped to $n$ physical processors. In each control thread, the program can define variables in the same way as in a sequential program. The variables created in this way are local variables. Their names may be replicated across processes, but they will be accessed individually (their scope is local to a process).

Besides local variables, HPJava allows a program to define global variables, explicitly mapped to a process group. A global variable will be treated by the process group that creating it as a single entity. The language has special syntax for the definition of global data. Global variables are all defined by using the new operator from free storage. When a global variable is created, a data descriptor is also allocated to describe where the data are held.


Bryan Carpenter 2002-07-11