next up previous
Next: Global variables Up: Basic concepts Previous: Subgroup and Subrange.


Structured SPMD programming.

When a process group is defined, a set of ranges and locations are also implicitly defined, as shown in figure 1.

Figure 1: Structured processes group
\begin{figure}\begin{center}
\leavevmode
\psfig{figure=group.eps} \end{center}\end{figure}
The two (primitive) ranges associated with dimensions of the group p are,
Range u=p.dim(0);  
Range v=p.dim(1);
dim() is a member function that returns a range reference, directly representing a processor dimension.

We can obtain a location in range v, and use it to create a new group,

Location j = v[1];
Group q = p/j;
As shown in the figure, group p is highly structured, The notions introduced around it contribute to program execution control in the new programming language.

In a traditional SPMD program, execution control is based on if statements and process id or rank numbers. In the new programming language, switching execution control is based on the structured process group. For example, it is not difficult to guess that the following code:

on(p) {
  ...
}
will restrict the execution control inside the bracket to processes in group p.

The language also provided well-defined constructs to split execution control across processes according to data items we want to access. This will be discussed later.


next up previous
Next: Global variables Up: Basic concepts Previous: Subgroup and Subrange.
Bryan Carpenter 2002-07-11