A flexible hybrid of data-parallel and low-level SPMD paradigms. HPF-like distributed arrays are language primitives. All access to non-local elements goes through library functions. Building on research carried out in the PCRC project, HPspmd provides a language framework to facilitate direct calls to established libraries for parallel programming with distributed data.
The underlying Distributed Array Descriptor (DAD) supports all layout options of HPF, but the programming model is explicitly SIMD. A preprocessor supports special syntax to represent distributed arrays, and minor language extensions to support common operations, like distributed parallel loops over elements of aligned arrays (“Structured SPMD” programming). Because communication is always explicit, irregular patterns of access to array elements can be handled by making explicit bindings to libraries such as CHAOS or Global Arrays.
In principle HPspmd extensions can be added to any programming language. Presently we are developing a translator for an HPspmd dialect of Java called HPJava. Initial communication libraries are the PCRC library Adlib, and a low-level message-passing library (mpiJava).
Work supported in part by NSF ACIR contract 9872125.

The HPspmd Model

Procs2 p = new Procs2(P,P);
on(p) {
Range x = new ExtBlockRange(N, p.dim(0), 1);
Range y = new ExtBlockRange(N, p.dim(1), 1);
float [[,]] u = new float [[x, y]],
. . .
for(int iter = 0; iter < NITER; iter++) {
Adlib.writeHalo(u);
overall(i = x for 1 : N-2)
overall(j = y for 1 + (i` + iter) % 2 : N-1 : 2)
u[i, j] = 0.25 * (u[i-1,j] + u[i+1,j] + u[i,j-1] + u[i,j+1]);
}
}

An “HPspmd” Programming Model

Language extensions

Principal syntax extensions illustrated by matrix addition

Procs p = new Procs2(P,P)
on(p) {
Range x = new BlockRange(N, p.dim(0));
Range y = new BlockRange(N, p.dim(1));
float [[,]] a = new float [[x,y]], b = new float [[x,y]],
c = new float [[x,y]];
overall(i = x for :)
overall(j = y for :)
c[i, j] = a[i, j] + b[i, j];
}

Communication Libraries

Stencil update explicitly calls library function to exchange edges

Bryan Carpenter, Geoffrey Fox, Han-Ku Lee, Guansong Zhang, Qiang Zheng

Northeast Parallel Architectures Center, University of Syracuse http://www.npac.syr.edu/projects/pcrc/HPJava/