How to write parallel programs: a guide to the perplexed

We present a framework for parallel programming, based on three conceptual classes for understanding parallelism and three programming paradigms for implementing parallel programs. The conceptual classes are result parallelism, which centers on parallel computation of all elements in a data structure; agenda parallelism, which specifies an agenda of tasks for parallel execution; and specialist parallelism, in which specialist agents solve problems cooperatively. The programming paradigms center on live data structures that transform themselves into result data structures; distributed data structures that are accessible to many processes simultaneously; and message passing, in which all data objects are encapsulated within explicitly communicating processes. There is a rough correspondence between the conceptual classes and the programming methods, as we discuss. We begin by outlining the basic conceptual classes and programming paradigms, and by sketching an example solution under each of the three paradigms. The final section develops a simple example in greater detail, presenting and explaining code and discussing its performance on two commercial parallel computers, an 18-node shared-memory multiprocessor, and a 64-node distributed-memory hypercube. The middle section bridges the gap between the abstract and the practical by giving an overview of how the basic paradigms are implemented. We focus on the paradigms, not on machine architecture or programming languages: The programming methods we discuss are useful on many kinds of parallel machine, and each can be expressed in several different parallel programming languages. Our programming discussion and the examples use the parallel language C-Linda for several reasons: The main paradigms are all simple to express in Linda; efficient Linda implementations exist on a wide variety of parallel machines; and a wide variety of parallel programs have been written in Linda.

[1]  John Feo,et al.  On the Implementation of Applicative Languages on Shared-Memory, MIMD Multiprocessors , 1988, PPOPP/PPEALS.

[2]  Willy Zwaenepoel,et al.  Distributed process groups in the V Kernel , 1985, TOCS.

[3]  Harry F. Jordan,et al.  Structuring parallel algorithms in an MIMD, shared memory environment , 1986, Parallel Comput..

[4]  Gilles Kahn,et al.  The Semantics of a Simple Language for Parallel Programming , 1974, IFIP Congress.

[5]  Andrew P. Black,et al.  Fine-grained mobility in the Emerald system , 1987, TOCS.

[6]  Charles L. Seitz,et al.  The cosmic cube , 1985, CACM.

[7]  Marina C. Chen A parallel language and its compilation to multiprocessor machines or VLSI , 1986, POPL '86.

[8]  Nicholas Carriero,et al.  Parallel Programming in Linda , 1985, ICPP.

[9]  T. Anthony Marsland,et al.  Parallel Search of Strongly Ordered Game Trees , 1982, CSUR.

[10]  Ehud Shapiro,et al.  Concurrent PROLOG: Collected Papers , 1987 .

[11]  Robert A. Whiteside,et al.  Using Linda for supercomputing on a local area network , 1988, Proceedings. SUPERCOMPUTING '88.

[12]  A. A. Chien,et al.  Object-oriented concurrent programming in CST , 1988, C3P.

[13]  共立出版株式会社 コンピュータ・サイエンス : ACM computing surveys , 1978 .

[14]  Leslie Greengard,et al.  A fast algorithm for particle simulations , 1987 .

[15]  David May OCCAM , 1983, SIGP.

[16]  Graem A. Ringwood Parlog86 and the dining logicians , 1988, CACM.

[17]  Per Brinch Hansen,et al.  The programming language Concurrent Pascal , 1975, IEEE Transactions on Software Engineering.

[18]  William Leler,et al.  PIX, the latest NeWS , 1989, Digest of Papers. COMPCON Spring 89. Thirty-Fourth IEEE Computer Society International Conference: Intellectual Leverage.

[19]  C. A. R. Hoare,et al.  Monitors: an operating system structuring concept , 1974, CACM.

[20]  Satoshi Matsuoka,et al.  Using tuple space communication in distributed object-oriented languages , 1988, OOPSLA 1988.

[21]  Butler W. Lampson,et al.  Experience with processes and monitors in Mesa , 1980, CACM.

[22]  Paul Hudak Para-Functional Programming , 1986, Computer.

[23]  David L. Black,et al.  The duality of memory and communication in the implementation of a multiprocessor operating system , 1987, SOSP '87.

[24]  Nicholas Carriero,et al.  Applications experience with Linda , 1988, PPEALS '88.

[25]  Philip L. Roth,et al.  Portnoy's Complaint , 1969 .

[26]  Nicholas Carriero,et al.  Linda in context , 1989, CACM.

[27]  Henry Ledgard,et al.  Reference Manual for the ADA® Programming Language , 1983, Springer New York.

[28]  Andrew Birrell,et al.  Implementing remote procedure calls , 1984, TOCS.

[29]  John Feo,et al.  On the Implementation of Applicative Languages on Shared-Memory, MIMD Multiprocessors , 1988, PPOPP/PPEALS.

[30]  Nicholas Carriero,et al.  Distributed data structures in Linda , 1986, POPL '86.

[31]  W. Daniel Hillis,et al.  Data parallel algorithms , 1986, CACM.

[32]  Suresh Jagannathan,et al.  Environments as first class objects , 1987, POPL '87.

[33]  A. S. Xu,et al.  A FAULT-TOLERANT NETWORK KERNEL FOR LINDA , 1988 .

[34]  A. Klein,et al.  Tuple space integrated into Modula-2, implementation of the Linda concept on a hierarchical multiprocessor , 1989 .

[35]  Peter Henderson,et al.  Purely Functional Operating Systems , 1982 .

[36]  Robert H. Halstead,et al.  MULTILISP: a language for concurrent symbolic computation , 1985, TOPL.

[37]  Y. Braunstein,et al.  Information management , 1996 .

[38]  C. A. R. Hoare,et al.  Communicating sequential processes , 1978, CACM.

[39]  Niklaus Wirth,et al.  Modula: A language for modular multiprogramming , 1977, Softw. Pract. Exp..

[40]  Andrew S. Tanenbaum,et al.  The Design of a Capability-Based Distributed Operating System , 1986, Comput. J..

[41]  Satoshi Matsuoka,et al.  Using tuple space communication in distributed object-oriented languages , 1988, OOPSLA '88.

[42]  Nicholas Carriero,et al.  Applications experience with Linda , 1988, PPoPP 1988.