skip to main content
research-article

Seq no more: better strategies for parallel Haskell

Published:30 September 2010Publication History
Skip Abstract Section

Abstract

We present a complete redesign of evaluation strategies, a key abstraction for specifying pure, deterministic parallelism in Haskell. Our new formulation preserves the compositionality and modularity benefits of the original, while providing significant new benefits. First, we introduce an evaluation-order monad to provide clearer, more generic, and more efficient specification of parallel evaluation. Secondly, the new formulation resolves a subtle space management issue with the original strategies, allowing parallelism (sparks) to be preserved while reclaiming heap associated with superfluous parallelism. Related to this, the new formulation provides far better support for speculative parallelism as the garbage collector now prunes unneeded speculation. Finally, the new formulation provides improved compositionality: we can directly express parallelism embedded within lazy data structures, producing more compositional strategies, and our basic strategies are parametric in the coordination combinator, facilitating a richer set of parallelism combinators.

We give measurements over a range of benchmarks demonstrating that the runtime overheads of the new formulation relative to the original are low, and the new strategies even yield slightly better speedups on average than the original strategies

Skip Supplemental Material Section

Supplemental Material

haskell-1420-marlow.mov

References

  1. }}M. K. Aswad, P. W. Trinder, A. D. Al Zain, G. J. Michaelson, and J. Berthold. Low pain vs no pain multi-core Haskells. In TFP '09 - Draft Proc. of Symp. on Trends in Functional Programming, pages 112--130, Komarno, Slovakia, June 2009.Google ScholarGoogle Scholar
  2. }}C. Baker-Finch, D. J. King, and P. Trinder. An operational semantics for parallel lazy evaluation. In ICFP '00 - Intl. Conf. on Functional Programming, pages 162--173, Montreal, Canada, Sept. 2000. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}G. E. Blelloch. Programming parallel algorithms. Commun. ACM, 39 (3): 85--97, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}M. M. T. Chakravarty, R. Leshchinskiy, S. Peyton Jones, G. Keller, and S. Marlow. Data parallel Haskell: a status report. In DAMP '07 - Workshop on Declarative Aspects of Multicore Programming, pages 10--18, Nice, France, Jan. 2007. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}M. I. Cole. Algorithmic Skeletons: Structured Management of Parallel Computation. MIT Press & Pitman, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}C. Grelck and S.-B. Scholz. SAC - from high-level programming with arrays to efficient parallel execution. Parallel Processing Letters, 13 (3): 401--412, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  7. }}K. Hammond and G. Michaelson, editors. Research Directions in Parallel Functional Programming. Springer, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. }}T. Harris and S. Singh. Feedback directed implicit parallelism. In ICFP '07 - Intl. Conf. on Functional Programming, pages 251--264, Freiburg, Germany, Oct. 2007. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}T. Harris, S. Marlow, and S. Peyton Jones. Haskell on a shared-memory multiprocessor. In Haskell '05 - Workshop on Haskell, pages 49--61, Tallinn, Estonia, Sept. 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}D. Jones Jr., S. Marlow, and S. Singh. Parallel performance tuning for Haskell. In Haskell '09 - Symposium on Haskell, pages 81--92, Edinburgh, Scotland, Sept. 2009. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}H.-W. Loidl, P. W. Trinder, K. Hammond, S. B. Junaidu, R. G. Morgan, and S. L. Peyton Jones. Engineering parallel symbolic programs in GpH. Concurrency - Practice and Experience, 11 (12): 701--752, 1999.Google ScholarGoogle Scholar
  12. }}H.-W. Loidl, P. W. Trinder, and C. Butz. Tuning task granularity and data locality of data parallel GpH programs. Parallel Processing Letters, 11 (4): 471--486, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  13. }}R. Loogen, Y. Ortega-Mallén, and R. Peña-Marí. Parallel functional programming in Eden. J. Funct. Program., 15 (3): 431--475, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}S. Marlow, S. Peyton Jones, and S. Singh. Runtime support for multicore Haskell. In ICFP '09 - Intl. Conf. on Functional Programming, pages 65--78, Edinburgh, Scotland, Sept. 2009. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}C. McBride and R. Paterson. Applicative programming with effects. J. Funct. Program., 18 (1): 1--13, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}E. Mohr, D. A. Kranz, and R. H. Halstead Jr. Lazy task creation: A technique for increasing the granularity of parallel programs. IEEE Trans. Parallel Distrib. Syst., 2 (3): 264--280, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. }}R. S. Nikhil and Arvind. Implicit Parallel Programming in pH. Morgan Kaufmann Publishers, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}P. Prabhu, G. Ramalingam, and K. Vaswani. Safe programmable speculative parallelism. In PLDI '10 - Conf. on Programming Language Design and Implementation, pages 50--61, Toronto, Ontario, Canada, June 2010. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. }}N. Scaife, S. Horiguchi, G. Michaelson, and P. Bristow. A parallel SML compiler based on algorithmic skeletons. J. Funct. Program., 15 (4): 615--650, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. }}P. W. Trinder, K. Hammond, H.-W. Loidl, and S. L. Peyton Jones. Algorithms + strategy = parallelism. J. Funct. Program., 8 (1): 23--60, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}P. W. Trinder, H.-W. Loidl, and R. F. Pointon. Parallel and distributed Haskells. J. Funct. Program., 12 (4&5): 469--510, 2002. Special Issue on Haskell. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Seq no more: better strategies for parallel Haskell

        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 45, Issue 11
          HASKELL '10
          November 2010
          156 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2088456
          Issue’s Table of Contents
          • cover image ACM Conferences
            Haskell '10: Proceedings of the third ACM Haskell symposium on Haskell
            September 2010
            166 pages
            ISBN:9781450302524
            DOI:10.1145/1863523

          Copyright © 2010 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 30 September 2010

          Check for updates

          Qualifiers

          • research-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!