A practical functional program for the CRAY X-MP
- 1 January 1992
- journal article
- research article
- Published by Cambridge University Press (CUP) in Journal of Functional Programming
- Vol. 2 (1) , 81-126
- https://doi.org/10.1017/s0956796800000289
Abstract
One can have all the advantages of functional programming – correctness, clarity, simplicity, and flexibility – without any sacrifice in performance, even for a scientifically significant computation on a supercomputer. Therefore, why use Fortran? We demonstrate parity – equality of speed and storage use – between a program generated automatically from a functional specification and a program written by hand in the procedural style. To our knowledge, this demonstration of parity is the first for a program that solves a scientifically significant problem – quasi-linear hyperbolic partial differential equations – on a scientifically interesting supercomputer – the CRAY X-MP. We use pure Lisp, including higher-order functions, to express the functional specification for the PDE solver. We designed this specification for maximal clarity and flexibility, rather than for efficiency. Nevertheless, we obtain a highly efficient program to solve the PDEs: automated program transformations put back the missing efficiency as they produce an executable Fortran program from the specification. The generated Fortran program vectorizes on the CRAY X-MP and runs about 4% faster than a handwritten Fortran program for the same problem. We describe the problem and the specification, and some of the problem-domain-specific and hardware-specific transformations that we use to obtain the high-efficiency program.Keywords
This publication has 9 references indexed in Scilit:
- A report on the sisal language projectJournal of Parallel and Distributed Computing, 1990
- Massively parallel computation of conservation lawsParallel Computing, 1990
- An Optimising Compiler for a Modern Functional LanguageThe Computer Journal, 1989
- The Chalmers Lazy-ML CompilerThe Computer Journal, 1989
- Functional programming with quadtreesIEEE Software, 1989
- Code optimizations for lazy evaluationHigher-Order and Symbolic Computation, 1988
- Program Reusability through Program TransformationIEEE Transactions on Software Engineering, 1984
- Finite Differencing of Computable ExpressionsACM Transactions on Programming Languages and Systems, 1982
- Transformational component for programming language grammarPublished by Office of Scientific and Technical Information (OSTI) ,1970