Next: Distributed Arrays
Up: The HPJava Language
Previous: Multiarrays
Contents
Processes
An HPJava program is started concurrently in all members of some
process collection
.
From HPJava's point of view, the processes are arranged
by special objects representing process groups. In general the
processes in an HPJava group are arranged in multidimensional grids.
Suppose that a program is running concurrently on 6 or more
processes. Then, one defines a 2
3 process
grid by:
Procs2 is a class describing 2-dimensional grids of processes.
Figure 3.1 illustrates the grid p, which
assumes that the program was executing in 11 processes. The call to
the Procs2 constructor selected 6 of these available processes
and incorporated them into a grid.
Figure 3.1:
The process grids illustrated by p
|
|
Figure 3.2:
The Group hierarchy of HPJava.
|
|
Procs2 is a subclass of the special base class
Group. The Group class has a special status in the
HPJava language.
Figure 3.2 illustrates the full Group hierarchy.
Procs0 is a zero-dimensional process grid, which can only
have one process. Procs1 is one-dimensional process grid.
Generally, ProcsN is an N-dimensional process grid.
After creating p, we will want to run some code within the
process group. The on construct limits control to processes in
its parameter group. The code in the on construct is
only executed by processes that belong to p. The
on construct fixes p as the active process
group within its body.
Figure 3.3:
The process dimension and coordinates in
p.
|
|
The Dimension class represents a specific dimension or
axis of a particular process grid. Called process dimensions,
these are available through the inquiry method dim(r), where
is in the range
(
is the rank of the
grid). Dimension has a method crd(), which returns the
local process coordinate associated with the dimension.
Thus, the following HPJava program crudely illustrates the process
dimension and coordinates in p from Figure 3.3.
Next: Distributed Arrays
Up: The HPJava Language
Previous: Multiarrays
Contents
Bryan Carpenter
2004-06-09