Next: ProcessorsThreads, and Up: Implementing a Parallel Previous: Introduction

A Brief Introduction to pC++

The basic concept behind pC++ is the notion of a distributed collection, which is a type of concurrent aggregate ``container class'' [9][7]. More specifically, a collection is a structured set of objects distributed across the processing elements of the computer. In a manner designed to be completely consistent with HPF Fortran, the programmer must define a distribution of the objects in a collection over the processors and memory hierarchy of the target machine. As HPF becomes more available, future versions of the pC++ compiler will allow object level linking between distributed collections and HPF distributed arrays.

A collection can be an Array, a Grid, a Tree, or any other partitionable data structure. Collections have the following components:

The pC++ language has a library of standard collection classes that may be used (or subclassed) by the programmer [13][12][11][10]. This includes collection classes such as DistributedArray, DistributedMatrix, DistributedVector, and DistributedGrid. To illustrate the points above, consider the problem of creating a distributed by matrix of floating point numbers. We begin by building a Distribution. A distribution is defined by its number of dimensions, the size in each dimension and how the elements are mapped to the processors. Current distribution mappings include BLOCK, CYCLIC and WHOLE , but more general forms will be added later. For our example, let us assume that the distribution coordinate system is distributed over the processor's memories by mapping WHOLE rows of the distribution index space to individual processors using a CYCLIC pattern where the row is mapped to processor memory mod , on a processor machine.

pC++ uses a special implementation dependent library class called Processors. In the current implementation, it represents the set of all processors available to the program at run time. To build a distribution of some size, say by , with this mapping, one would write


Processors P;
Distribution myDist(7,7,&P,CYCLIC,WHOLE);

Next, we create an alignment object called myAlign that defines a domain and function for mapping the matrix to the distribution. The matrix A can be defined using the library collection class DistributedMatrix with a base type of Float.


Align myAlign(5,5,"[ALIGN(domain[i][j],
                          myMap[i][j])]");
DistributedMatrix<Float> A(myDist,myAlign);
The collection constructor uses the alignment object, myAlign, to define the size and dimension of the collection. The mapping function is described by a text string corresponding to the HPF alignment directives. It defines a mapping from a domain structure to a distribution structure using dummy index variables.

The intent of this two stage mapping, as it was originally conceived for HPF, is to allow the distribution coordinates to be a frame of reference so that different arrays could be aligned with each other in a manner that promotes memory locality.




Next: ProcessorsThreads, and Up: Implementing a Parallel Previous: Introduction


mohr@cs.uoregon.edu
Thu Feb 24 15:47:41 PST 1994