next up previous
Next: Accessing global variable Up: Program execution control Previous: Program execution control

Active process group

A new concept, active process group, is introduced here. it is the set of processes sharing the current thread of control.

In a traditional SPMD program, the concept of switching the active process group is reflected by if statement,

  if(myid>=0 && myid<4) {

means that inside the brace bracket, the processes numbered as 0 to 3 share the control thread.

In HPJava, this concept is expressed by a Group reference. When a HPJava program starts, the active process group is a system pre-defined value, During the execution, the active process group can be set explicitly through an on construct in the language, for example

  on(p) {

This will change the active process group of the code inside the bracket to Group p, which means that every statement inside the bracket is only executed by the processes inside Group p.

Bryan Carpenter 2002-07-12