skip to main content
article

Farms, pipes, streams and reforestation: reasoning about structured parallel processes using types and hylomorphisms

Published:04 September 2016Publication History
Skip Abstract Section

Abstract

The increasing importance of parallelism has motivated the creation of better abstractions for writing parallel software, including structured parallelism using nested algorithmic skeletons. Such approaches provide high-level abstractions that avoid common problems, such as race conditions, and often allow strong cost models to be defined. However, choosing a combination of algorithmic skeletons that yields good parallel speedups for a program on some specific parallel architecture remains a difficult task. In order to achieve this, it is necessary to simultaneously reason both about the costs of different parallel structures and about the semantic equivalences between them. This paper presents a new type-based mechanism that enables strong static reasoning about these properties. We exploit well-known properties of a very general recursion pattern, hylomorphisms, and give a denotational semantics for structured parallel processes in terms of these hylomorphisms. Using our approach, it is possible to determine formally whether it is possible to introduce a desired parallel structure into a program without altering its functional behaviour, and also to choose a version of that parallel structure that minimises some given cost model.

References

  1. F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Y.-Y. Chi and S.-C. Mu. Constructing List Homomorphisms from Proofs. In Proc. APLIAS ’11: Asian Symposium on Programming Languages & Systems, pages 74–88. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. I. Cole. Algorithmic Skeletons: Structured Management of Parallel Computation. Pitman, London, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Fischer and S. Gorlatch. Turing Universality of Recursive Patterns for Parallel Programming. Parallel Processing Letters, 12(02):229– 246, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  5. M. M. Fokkinga and E. Meijer. Program Calculation Properties of Continuous Algebras. Technical Report, CWI, 1991.Google ScholarGoogle Scholar
  6. A. Geser and S. Gorlatch. Parallelizing Functional Programs by Generalization. Journal of Functional Programming (JFP), 9(06): 649–673, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. N. Ghani. βη-Equality for Coproducts. In Proc. International Conf. on Typed Lambda Calculi and Applications, pages 171–185. 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. Gibbons. Computing Downwards Accumulations on Trees Quickly. Theoretical Computer Science, 169(1):67–80, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Gibbons. The Third Homomorphism Theorem. Journal of Functional Programming (JFP), 6(4):657–665, 1996.Google ScholarGoogle Scholar
  10. J. Gibbons. Calculating Functional Programs. In Algebraic and Coalgebraic Methods in the Mathematics of Program Construction, pages 151–203. 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Gorlatch. Extracting and Implementing List Homomorphisms in Parallel Program Development. Science of Computer Programming, 33(1):1 – 27, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Gorlatch and C. Lengauer. Parallelization of Divide-and-Conquer in the Bird-Meertens Formalism. Formal Aspects of Computing, 7(6): 663–682, 1995.Google ScholarGoogle ScholarCross RefCross Ref
  13. T. Hardin. Confluence Results for the Pure Strong Categorical Logic CCL. λ-calculi as Subsystems of CCL. Theoretical Computer Science, 65(3):291–342, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Y. Hayashi and M. Cole. Static Performance Prediction of Skeletal Parallel Programs. Parallel Algorithms and Applications, 17(1):59– 84, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  15. Z. Hu, H. Iwasaki, and M. Takechi. Formal Derivation of Efficient Parallel Programs by Construction of List Homomorphisms. ACM Transactions on Programming Languages and Systems (TOPLAS), 19 (3):444–461, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Z. Hu, M. Takeichi, and W.-N. Chin. Parallelization in Calculational Forms. In Proc. POPL ’98: 25th ACM Symposium on Principles of Programming Languages, pages 316–328, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. J. Hughes, L. Pareto, and A. Sabry. Proving the Correctness of Reactive Systems Using Sized Types. In Proc. POPL ’96: 23rd ACM Symposium on Principles of Programming Languages, pages 410– 423, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. G. Keller and M. Chakravarty. Flattening Trees. In Proc. Euro-Par ’98: European Conference on Parallelism, pages 709–719. 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Y. Liu, Z. Hu, and K. Matsuzaki. Towards Systematic Parallel Programming over Mapreduce. In Proc. Euro-Par 2011: European Conference on Parallelism, pages 39–50. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. O. Lobachev and R. Loogen. Estimating Parallel Performance, a Skeleton-Based Approach. In Proc. HLPA ’10: Intl workshop on Highlevel Parallel Prog. and Appls., pages 25–34, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. K. Matsuzaki, Z. Hu, and M. Takeichi. Towards Automatic Parallelization of Tree Reductions in Dynamic Programming. In Proc. SPAA 2006: Symposium on Parallelism in Algorithms and Architecture, pages 39–48, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. E. Meijer, M. Fokkinga, and R. Paterson. Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. In Proc. ICFP ’91: ACM Conf. on Functional Programming, pages 124–144, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. Misra. Powerlist: A Structure for Parallel Recursion. ACM Transactions on Programming Languages and Systems (TOPLAS), 16(6): 1737–1767, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. A. Morihata. A Short Cut to Parallelization Theorems. In Proc. ICFP 2013: 18th ACM Conf. on Functional Programming, pages 245–256, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Morihata and K. Matsuzaki. Automatic Parallelization of Recursive Functions using Quantifier Elimination. In Proc. FLOPS ’10: Functional and Logic Programming, pages 321–336. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. K. Morita, A. Morihata, K. Matsuzaki, Z. Hu, and M. Takeichi. Automatic Inversion Generates Divide-and-Conquer Parallel Programs. In Proc. PLDI ’07: ACM Conf. on Programming Language Design and Implementation, pages 146–155, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. R. Pe˜na and C. Segura. Sized Types for Typing Eden Skeletons. In Proc. IFL ’01: Intl. Symposium on Implementation of Functional Languages, pages 1–17, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. F. A. Rabhi and S. Gorlatch. Patterns and Skeletons for Parallel and Distributed Computing. Springer, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. H. Reif. Synthesis of Parallel Algorithms. Morgan Kaufmann, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. D. B. Skillicorn. Models for Practical Parallel Computation. International Journal of Parallel Programming, 20(2):133–158, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  31. D. B. Skillicorn. The Bird-Meertens Formalism as a Parallel Model. Springer, 1993.Google ScholarGoogle ScholarCross RefCross Ref
  32. D. B. Skillicorn and W. Cai. A Cost Calculus for Parallel Functional Programming. J. Parallel Distrib. Comput., 28(1):65–83, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. M. Steuwer, C. Fensch, S. Lindley, and C. Dubach. Generating Performance Portable Code Using Rewrite Rules. In Proc ICFP 2015: 20th ACM Conf. on Functional Prog. Lang. and Comp. Arch., pages 205–217, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. J. E. Stoy. Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, Cambridge, MA, USA, 1977. ISBN 0262191474. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. H. Yokouchi. Church-Rosser Theorem for a Rewriting System on Categorical Combinators. Theoretical Computer Science, 65(3):271– 290, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Farms, pipes, streams and reforestation: reasoning about structured parallel processes using types and hylomorphisms

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 51, Issue 9
            ICFP '16
            September 2016
            501 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/3022670
            Issue’s Table of Contents
            • cover image ACM Conferences
              ICFP 2016: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming
              September 2016
              501 pages
              ISBN:9781450342193
              DOI:10.1145/2951913

            Copyright © 2016 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 4 September 2016

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!