PEI: A language and its refinement calculus for parallel programming

  • View

  • Download

Embed Size (px)


  • Parallel Computing 18 (1992) 1167-1184 North-Holland


    PARCO 704

    PEI: A language and its refinement calculus for parallel programming *

    E. Vio lard and G.-R. Perr in

    University of Franche-Comt~, Laboratoire d'lnformatique, F-25030 Besant~on cedex, France

    Received 11 February 1992


    Violard, E. and G.-R. Perrin, PEI: A language and its refinement calculus for parallel programming. Parallel Computing 18 (1992) 1167-1184.

    The aim of this paper is to introduce a new modeling, using symbols and functional notations, called the language PEI (as Parallel Equations Interpretor), which could unify the classical approaches of program parallelization, according to the sorts of problems and the target computation schemes. Due to its fundamental structure, disconnected from concrete drawings, this modeling offers a straightforward generalization to adress convex or non-convex computation domains, synchronous or asynchronous computa- tions. This sort of programming formalism allows a powerful structuration of statements and a stepwise transforma- tion technique based on a semantical equivalence definition and a refinement calculus. From initial problem statements, transformations of expressions lead to various definition structures, which can match given computation models.

    Keywords. Recurrence equations; functional language; systolic algorithms; parallel architectures; program equivalence; refinement.

    0. Introduction

    It is now admitted that reliable parallel programming techniques should be founded on formal transformations of programs, defined from data dependencies analysis and taking architectural-related computing models into account. To manage these transformations safely, a convenient formalism has to be defined, to express the successive statements, and the transformation rules themselves (cf. the works of Chandy and Misra [2]).

    Due to the results of Karp, Miller and Winograd [8], a convenient abstract expression of programs c~n be a set of recurrence equations. Indeed, prefiguring architecture evolutions, the introduction of the uniform recurrence equations did define a formal frame where the classical notions of data dependencies, potential parallelism and computation scheduling were presented.

    Since this presentation many proposals have generalized this abstract modeling. Affine recurrences on integral convex domains are mainly studied for systolic synthesis (see for example [5,9,14,11], etc., and ALPHA [10] or CRYSTAL [3] for language aspects). Other

    * This work has been supported by the French Coordinated Research Program C 3 of the CNRS. Correspondence to: E. Violard, University of Franche-Comt~, La~ratoire d'lnformatique, F-25030 Besan~on cedex, France, email: violard@comte.uucp

    0i67-8191/92/$05.00 1992 - Elsevier Science Publishers B.V. All rights reserved

  • 1168 E. Violard and G.-R. Perrin

    modelings are based on explicit data flow expressions: see for example the design of the language LUSTRE for reactive systems ([13]). All these formal frames, each of them relative to some tar.get computation scheme, allow - fruitful results due to their strict mathematical semantics~ b~t they also find their limit according to more general sorts of problems and to new architecture proposals. Some other languages are based on non-deterministic transitions on a multiset of values, from which an efficient execution model has to be defined (see e.g. :[11).

    Our aim is to introduce a new modeling called the language PEI (as Parallel Equations Interpretor), which could unify the classical approaches of program parallelization, according to the sorts of problems and the target computation schemes. A program will be presented as a set of equations on symbols and functions, in such a way that they imply a very simple semantics substitution rule. Many syntactical transformations can then operate on equations, as folding, unfolding, application, abstraction, etc.

    So, a problem and its solutions can be expressed with this single language PEI. The design of the solutions consists in transforming statements and maintaining the global semantics of the problem. The transformations are expressed in PEI too, by defining operators and equivalence rules. They are particular steps of a general refinement process going from abstract programs, satisfying some specifications, to an executable coding.

    Section 1 is devoted to a definition of the language. After a short presentation of its main notation aspects, a mathematical semantics of the language is introduced. It is based on the concept of multiset and data field. Operators on data fields define the semantics of the language constructions. In Section 2, we present transformation rules. A refinement calculus of PEI programs is presented in Section 3, which introduces the operational semantics of the language. Section 4 details the classical example of the Gaussian elimination algorithm. Last, related works are compared in Section 5.

    1. Presentation of the language

    1.1. A short presentation

    Classical languages founded on the recurrence equations concept (ALPHA [10] or CRYS- TAL [3] for example) consider variables or expressions as functions which map index sets to a set of values. These function domains are built from integral convex polyhedra in Z n. The domain and the values of the variables are defined from equations which define the data dependencies.

    Example. The mat~rix-vector product. Let 3 - (a , ,~) an mp matrix, V=(v k) a p-dimensional vector and X=A.V . Each

    component x i of X is defined by: p

    xi~- ~a i ,kV k, l

  • PEI: A language and its refinement 1169

    Other languages such as GAMMA [1] or LINDA [6] are founded on non-deterministic transitions on a multiset of values. The main problem for these expressions is to define an efficient execution model. Nevertheless they express in a nice abstract way a very large class of problems.

    A program in PEI benefits of such an abstraction of the variables domains, but fundamen- tally PEI is a recurrence equation language. Variables are defined as sets of values on abstract domains which are in fact the set of all their possible geometrical drawings in 7/n. They denote structures called data fields.

    A program in PEI is of the form

    W: [[ PRE; POST 1]

    where W is the list of output variables, PRE and POST are lists of equations E = E', where E and E ' are expressions built from operators on variables. An equation in the PRE part generally defines the geometrical drawing of an input variable domain. Equations in the POST part define output or intermediate variables.

    Operators either define the computations of the values of a data field (summation and product on the previous example), or express the data dependencies (the uniform dependen- cies (0, 1) hereabove), or refer any constructive aspect of data fields.

    Example. The matrix-vector product (continued). In PEI, the previous problem can be expressed in the following way. Matrices A and S are

    real-data fields whose geometrical drawings in 7/2 are {(i, k)l 1 < i < m A 1 < k < p}. Vectors V and X are real-data fields whose drawings are {k I 1 _< k < p}. This is the PRE part of the program defining the drawing of the input data fields:

    A =A(i, k) l (1

  • 1170 E. I/iolard and G.-R. Perrin

    This means that a sub-data field of S whose drawing is {(i, k) l l < i

  • PEI: A language and its refinement

    Fig. 1. A multiset of values.


    So, any element v of ,~ multiset M is described by a pair (v, ref), where ref distinguishes clones of v in M. To organize the index set in a partial computation ordering, ref is defined as a pair or:z, where z denotes a geometrical coordinate in Z n and or is any bijection from Z ~ to 7/m. This bijection or means all the possible transformations on these coordinates, in order to yield a convenient computation ordering on Z m. We say that M is described as a set, in a relative way, within the bijection or.

    Definition 1. We call data field any set of the form {(v, or:z)/v ~ M}, where M is a multiset, z denotes elements of 7/n and or is a bijection from 7/n to 7/m.

    Definition 2. Let X a data field, We call drawing of X the subset {z/(v, or:z) ~X} of Z n (Fig. 2).

    The values in the multiset associated with a given data field have the same type, say v. Such data fields are called v-data fields.

    Examples - Let c an element of v and R a predicate. {(c, or:z)/R(z)} is a constant data field, whose

    drawing is the set of points z satisfying R. - Let P=-

  • 1172 E. Violard and G.-R. Perrin

    2 2 0

    1 ~ 1 ~ 1

    Fig. 2. An example of data field associated with the multiset on Fig. 1: (a) an initial drawing, (b) a drawing resulting of some bijection o- from 7/2 to 7/2, (c) an associated partial order.

    Particular notations - hx.f(x) denotes hx/true.f(x), - hx/P(x) denotes Ax/P(x).x.

    Examples - The expression hx/(x > 0). l /x denotes an operator in PEI defined from the function

    which inverses any positive number. - Let us consider the operator denoted by Ax/(x > 0).2 x in PEI. The inverse of this

    operator is denoted either by hx/ (x > 0).2 Xx ^ or by hx/(x > 0).x/2.

    1.3.1. Functional operators A functional operator defines comrmtations or extractions of some values of a data field.

    Definition 3. Let f be any function from v to w, and X a v-data field. The application of the function f on X defines the w-data field {(f(v), cr:z)/(v, ~r: z) ~X ^ v ~Df} (Fig. 3).

    Notation. The application of a functional operator hv/P(v).f(v) on an expression of type data field E is denoted in PEI by hv/P(v