Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3122948.3122951acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

In search of a map: using program slicing to discover potential parallelism in recursive functions

Published: 07 September 2017 Publication History

Abstract

Recursion schemes, such as the well-known map, can be used as loci of potential parallelism, where schemes are replaced with an equivalent parallel implementation. This paper formalises a novel technique, using program slicing, that automatically and statically identifies computations in recursive functions that can be lifted out of the function and then potentially performed in parallel. We define a new program slicing algorithm, build a prototype implementation, and demonstrate its use on 12 Haskell examples, including benchmarks from the NoFib suite and functions from the standard Haskell Prelude. In all cases, we obtain the expected results in terms of finding potential parallelism. Moreover, we have tested our prototype against synthetic benchmarks, and found that our prototype has quadratic time complexity. For the NoFib benchmark examples we demonstrate that relative parallel speedups can be obtained (up to 32.93× the sequential performance on 56 hyperthreaded cores).

References

[1]
Joonseon Ahn and Taisook Han. 2000. An Analytical Method for Parallelization of Recursive Functions. Parallel Processing Letters 10, 1 (2000), 87–98.
[2]
Adam D. Barwell, Christopher Brown, David Castro, and Kevin Hammond. 2016. Towards Semi-automatic Data-type Translation for Parallelism in Erlang. In Proceedings of the 15th International Workshop on Erlang (Erlang 2016). 60–61.
[3]
Adam D. Barwell, Christopher Brown, Kevin Hammond, Wojciech Turek, and Aleksander Byrski. 2016. Using Program Shaping and Algorithmic Skeletons to Parallelise an Evolutionary Multi-Agent System in Erlang. Computing and Informatics 35, 4 (2016), 792–818.
[4]
Adam D. Barwell and Kevin Hammond. 2017. Obliterating Obstructions: Discovering Potential Parallelism by Slicing for Dependencies in Recursive Functions. International Journal of Parallel Programming (2017). In submission.
[5]
Cedric Bastoul. 2004. Code Generation in the Polyhedral Model Is Easier Than You Think. In Proc. of the 13th Intl. Conf. on Parallel Architectures and Compilation Techniques (PACT ’04). 7–16.
[6]
István Bozó, Viktoria Fordós, Zoltán Horvath, Melinda Tóth, Dániel Horpácsi, Tamás Kozsik, Judit Köszegi, Adam Barwell, Christopher Brown, and Kevin Hammond. 2014. Discovering Parallel Pattern Candidates in Erlang. In Proc. of the 13th ACM SIGPLAN Workshop on Erlang (Erlang ’14). 13–23.
[7]
Christopher Brown, Marco Danelutto, Kevin Hammond, Peter Kilpatrick, and Archibald Elliott. 2013. Cost-Directed Refactoring for Parallel Erlang Programs. International Journal of Parallel Programming (2013), 1–19.
[8]
R. M. Burstall and John Darlington. 1977. A Transformation System for Developing Recursive Programs. J. ACM 24, 1 (Jan. 1977), 44–67.
[9]
David Castro, Kevin Hammond, and Susmit Sarkar. 2016. Farms, Pipes, Streams and Reforestation: Reasoning About Structured Parallel Processes Using Types and Hylomorphisms. In Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming (ICFP 2016). 4–17.
[10]
Manuel M.T. Chakravarty, Gabriele Keller, Sean Lee, Trevor L. McDonell, and Vinod Grover. 2011. Accelerating Haskell Array Codes with Multicore GP Us. In Proc. of the 6th Workshop on Declarative Aspects of Multicore Programming. 3–14.
[11]
Murray I. Cole. 1988. Algorithmic Skeletons: A Structured Approach to the Management of Parallel Computation. Ph.D. Dissertation.
[12]
A. Cook, A. Ireland, G. Michaelson, and N. Scaife. 2005. Discovering Applications of Higher Order Functions Through Proof Planning. Form. Asp. Comput. 17, 1 (May 2005), 38–57.
[13]
Michael Dever and G. W. Hamilton. 2014. AutoPar: Automatic Parallelization of Functional Programs. In 2014 4th Int. Valentin Turchin Workshop on Metacomputation (META 2014). 11–25.
[14]
R. Ferenc, A. Beszedes, L. Fulop, and J. Lele. 2005. Design pattern mining enhanced by machine learning. In 21st IEEE International Conference on Software Maintenance (ICSM’05). 295–304.
[15]
F. Gava and F. Loulergue. 2005. A static analysis for Bulk Synchronous Parallel ML to avoid parallel nesting. Future Generation Computer Systems 21, 5 (2005), 665 – 671.
[16]
Louis Gesbert, FrÃľdÃľric Gava, FrÃľdÃľric Loulergue, and FrÃľdÃľric Dabrowski. 2010. Bulk synchronous parallel ML with exceptions. Future Generation Computer Systems 26, 3 (2010), 486 – 490.
[17]
Alfons Geser and Sergei Gorlatch. 1999. Parallelizing Functional Programs by Generalization. J. Functional Programming 9, 06 (1999), 649–673.
[18]
Jeremy Gibbons. 1996. The Third Homomorphism Theorem. Journal of Functional Programming (JFP) 6, 4 (1996), 657–665.
[19]
Sergei Gorlatch. 1999. Extracting and Implementing List Homomorphisms in Parallel Program Development. Science of Computer Programming 33, 1 (1999).
[20]
J. C. Guzman and P. Hudak. 1990. Single-threaded polymorphic lambda calculus. In Logic in Computer Science. 333–343.
[21]
Clemens Hammacher, Kevin Streit, Sebastian Hack, and Andreas Zeller. 2009. Profiling Java Programs for Parallelism. In Proceedings of the 2009 ICSE Workshop on Multicore Software Engineering (IWMSE ’09). 49–55.
[22]
Kevin Hammond, Marco Aldinucci, Christopher Brown, Francesco Cesarini, Marco Danelutto, Horacio González-Vélez, Peter Kilpatrick, Rainer Keller, Michael Rossbory, and Gilad Shainer. 2013. The ParaPhrase Project: Parallel Patterns for Adaptive Heterogeneous Multicore Systems. In Formal Methods for Components and Objects. Lecture Notes in Computer Science, Vol. 7542. Springer Berlin Heidelberg, 218–236.
[23]
Steve Holzner. 2004. Eclipse: A Java Developer’s Guide. O’Reilly & Associates, Inc., Sebastopol, CA, USA.
[24]
Zhenjiang Hu, Masato Takeichi, and Hideya Iwasaki. 1999. Diffusion: Calculating Efficient Parallel Programs. In Proc. PEPM’99. 85–94.
[25]
V. Janjic, C. Brown, and K. Hammond. 2016. Lapedo: Hybrid Skeletons for Programming Heterogeneous Multicore Machines in Erlang. In Proc. ParCo 2015: Intl. Conf. on Parallel Computing. 181–195.
[26]
Venkatesh Kannan and Geoff W. Hamilton. 2016. Program Transformation to Identify Parallel Skeletons. In 24th Euromicro International Conference on Parallel, Distributed, and Network-Based Processing, PDP 2016, Heraklion, Crete, Greece, February 17-19, 2016. 486–494.
[27]
Huiqing Li and Simon Thompson. 2015. Safe Concurrency Introduction Through Slicing. In PEPM ’15. 103–113.
[28]
Huiqing Li, Simon J. Thompson, George Orösz, and Melinda Tóth. 2008. Refactoring with wrangler, updated: data and process refactorings, and integration with eclipse. In Proc. of the 7th ACM SIGPLAN Workshop on Erlang. 61–72.
[29]
Simon Marlow, Patrick Maier, Hans-Wolfgang Loidl, Mustafa K. Aswad, and Phil Trinder. 2010. Seq No More: Better Strategies for Parallel Haskell. In Proc. of the 3rd ACM Haskell Symp. on Haskell (Haskell ’10). 91–102.
[30]
Simon Marlow, Ryan Newton, and Simon Peyton Jones. 2011. A Monad for Deterministic Parallelism. In Proc. of the 4th ACM Symposium on Haskell (Haskell ’11). 71–82.
[31]
Erik Meijer, Maarten Fokkinga, and Ross Paterson. 1991. Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. In Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture. 124–144.
[32]
Will Partain. 1993. The nofib Benchmark Suite of Haskell Programs. In Proc. of the 1992 Glasgow Workshop on Functional Programming, John Launchbury and Patrick Sansom (Eds.).
[33]
Benjamin C. Pierce. 2004. Advanced Topics in Types and Programming Languages. The MIT Press.
[34]
Martin P. Robillard. 2008. Topology Analysis of Software Dependencies. ACM Trans. Softw. Eng. Methodol. 17, 4, Article 18 (Aug. 2008), 36 pages.
[35]
Norman Scaife, Susumi Horiguchi, Greg Michaelson, and Paul Bristow. 2005. A parallel SML compiler based on algorithmic skeletons. Journal of Functional Programming 15, 4 (2005), 615–650.
[36]
Temple F Smith and Michael S Waterman. 1981. Identification of common molecular subsequences. Journal of molecular biology 147, 1 (1981), 195–197.
[37]
P. W. Trinder, K. Hammond, H.-W. Loidl, and S. L. Peyton Jones. 1998. Algorithm + Strategy = Parallelism. J. Funct. Program. 8, 1, 23–60.
[38]
Mark Weiser. 1981. Program Slicing. In Proc. of the 5th Intl. Conf. on Software Engineering (ICSE ’81). 439–449.

Cited By

View all
  • (2019)STCLang: state thread composition as a foundation for monadic dataflow parallelismProceedings of the 12th ACM SIGPLAN International Symposium on Haskell10.1145/3331545.3342600(146-161)Online publication date: 8-Aug-2019

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
FHPC 2017: Proceedings of the 6th ACM SIGPLAN International Workshop on Functional High-Performance Computing
September 2017
52 pages
ISBN:9781450351812
DOI:10.1145/3122948
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 September 2017

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Parallelism
  2. Pattern Discovery
  3. Program Slicing
  4. Recursion Schemes

Qualifiers

  • Research-article

Funding Sources

Conference

ICFP '17
Sponsor:

Acceptance Rates

Overall Acceptance Rate 18 of 25 submissions, 72%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)2
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2019)STCLang: state thread composition as a foundation for monadic dataflow parallelismProceedings of the 12th ACM SIGPLAN International Symposium on Haskell10.1145/3331545.3342600(146-161)Online publication date: 8-Aug-2019

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media