A calculational approach to flattening nested data parallelism in functional languages

  • Gabriele Keller
  • Martin Simons
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1179)


The data-parallel programming model is currently the most successful model for programming massively parallel computers. Unfortunately, it is, in its present form, restricted to exploiting flat data parallelism, which is not suitable for some classes of algorithms, e.g. those operating on irregular structures. Recently, some effort has been made to implement nested data-parallel programs efficiently by compiling them into equivalent flat programs using a transformation called flattening. However, previous translations of nested into flat data-parallel programs have proved unwieldy when it comes to inventing and specifying optimizations and verifying the translation. This paper presents a new formalization of the flattening transformation in a calculational style. The formalization is easily verified and provides a good starting point for the development of new optimizations. Some optimizations invented on the basis of this new formalism are described. Furthermore, we present practical evidence obtained by experimenting with an implementation of the transformation.


parallel programming functional programming nested data parallelism flattening transformation implementation calculational method 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    P. K. T. Au, M. M. T. Chakravarty, J. Darlington, Y. Guo, S. Jährlichen, G. Keller, M. Köhler, M. Simons, and W. Pfannenstiel. Enlarging the scope of vector-based computations: extending Fortran 90 with nested data parallelism. In W. Giloi, ed., Intl. Conf. on Advances in Parallel and Distributed Computing. IEEE Computer Society, 1997.Google Scholar
  2. 2.
    R. Backhouse. The calulational method. Inf. Process. Lett., 53, 1995.Google Scholar
  3. 3.
    R. Bird. An introduction to the theory of lists. In M. Broy, ed., Logic of Programming and Calculi of Discrete Design, pp. 3–42. Springer, 1986.Google Scholar
  4. 4.
    G. E. Blelloch. Vector Models for Data-Parallel Computing. The MIT Press, 1990.Google Scholar
  5. 5.
    G. E. Blelloch. Nesl: A nested data-parallel language. TR CMU-CS-95-170, CMU, 1995.Google Scholar
  6. 6.
    G. E. Blelloch. Programming parallel algorithms. Commun. ACM, 39(3):85–97, 1996.CrossRefGoogle Scholar
  7. 7.
    G. E. Blelloch, S. Chatterjee, J. C. Hardwick, M. Reid-Miller, J. Sipelstein, and M. Zagha. CVL: A C vector library. TR CMU-CS-93-114, CMU, 1993.Google Scholar
  8. 8.
    G. E. Blelloch, S. Chatterjee, J. C. Hardwick, J. Sipelstein, and M. Zagha. Implementation of a portable nested data-parallel language. J. Par. Distr. Comput., 21(1):4–14, 1994.CrossRefGoogle Scholar
  9. 9.
    M. M. T. Chakravarty, F.-W. Schröer, and M. Simons. V—Nested parallelism in C. In Giloi et al. [10], pp. 167–174.Google Scholar
  10. 10.
    W. K. Giloi, S. Jähnichen, and B. D. Shriver, eds. Programming Models for Massively Parallel Computers. IEEE Computer Society, 1995.Google Scholar
  11. 11.
    D. Gries and F. B. Schneider. Avoiding the undefined by underspecification. In J. van Leeuwen, ed., Computer Science Today, LNCS 1000, pp. 366–373. Springer, 1996.Google Scholar
  12. 12.
    HPF Forum. HPF language specification (Version 1.0). Tech. rep., Rice University, 1993.Google Scholar
  13. 13.
    C. B. Jay. A semantics for shape. Sci. Comput. Programming, 25:251–283, 1995.CrossRefGoogle Scholar
  14. 14.
    S. Liang and P. Hudak. Modular denotational semantics for compiler construction. In H. R. Nielson, ed., Europ. Symp. on Programming (ESOP'96), LNCS 1058. Springer, 1996.Google Scholar
  15. 15.
    D. Palmer, J. Prins, and S. Westfold. Work-efficient nested data-parallelism. In 5th Symp. on the Front. of Massively Parallel Processing. IEEE Computer Society, 1995.Google Scholar
  16. 16.
    J. Prins and D. Palmer. Transforming high-level data-parallel programs into vector operations. In 4th ACM Symp. on Princ. and Pract. of Parall. Programming, pp. 119–128, 1993.Google Scholar
  17. 17.
    J. W. Riely, J. Prins, and S. P. Iyer. Provably correct vectorization of nested-parallel programs. In Giloi et al. [10], pp. 213–222.Google Scholar
  18. 18.
    G. W. Sabot. The Paralation Model: Architecture-Independent Parallel Programming. The MIT Press, 1988.Google Scholar
  19. 19.
    Thinking Machines Corporation. C * Language Reference Manual, 1991.Google Scholar
  20. 20.
    P. Wadler. Comprehending monads. Math. Struct. in Comp. Sci., 2:461–493, 1992.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Gabriele Keller
    • 1
  • Martin Simons
    • 1
  1. 1.Forschungsgruppe Softwaretechnik (FR5-6)Technische Universität BerlinBerlin

Personalised recommendations