Skip to main content

Automatic Parallelization of Recursive Functions Using Quantifier Elimination

  • Conference paper
Functional and Logic Programming (FLOPS 2010)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6009))

Included in the following conference series:

Abstract

Although the recent popularity of parallel-computing environments has called for parallel programs, it is difficult for nonspecialists to develop those that are efficient. What is required are parallelization methods that can automatically generate efficient parallel programs from sequential ones. In this paper, we propose an automatic method of parallelization for recursive functions. The key is a quantifier-elimination-based derivation of an operator that shrinks function closures representing partial computations. Once we obtain such an operator, we can split the input structure and perform computation on each part in parallel. Our method has several features: it does not require any human help, it guarantees computational efficiency of generated programs, and it deals with complicated recursive functions such as those that are nonlinear recursive, non-self recursive, and accumulative.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Fisher, A.L., Ghuloum, A.M.: Parallelizing complex scans and reductions. In: Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, pp. 135–146. ACM, New York (1994)

    Chapter  Google Scholar 

  2. Xu, D.N., Khoo, S.C., Hu, Z.: Ptype system: A featherweight parallelizability detector. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 197–212. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  3. Größlinger, A., Griebl, M., Lengauer, C.: Quantifier elimination in automatic loop parallelization. Journal of Symbolic Computation 41(11), 1206–1221 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  4. Matsuzaki, K., Hu, Z., Takeichi, M.: Towards automatic parallelization of tree reductions in dynamic programming. In: SPAA 2006: Proceedings of the 18th Annual ACM Symposium on Parallel Algorithms and Architectures, pp. 39–48. ACM, New York (2006)

    Chapter  Google Scholar 

  5. Morita, K., Morihata, A., Matsuzaki, K., Hu, Z., Takeichi, M.: Automatic inversion generates divide-and-conquer parallel programs. In: Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation, pp. 146–155. ACM, New York (2007)

    Chapter  Google Scholar 

  6. Tournavitis, G., Wang, Z., Franke, B., O’Boyle, M.F.P.: Towards a holistic approach to auto-parallelization: integrating profile-driven parallelism detection and machine-learning based mapping. In: Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 177–187. ACM, New York (2009)

    Chapter  Google Scholar 

  7. Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, 2nd edn. Addison-Wesley, Reading (2006)

    Google Scholar 

  8. Caviness, B.F., Johnson, J.R. (eds.): Quantifier Elimination and Cylindrical Algebraic Decomposition. Springer, Heidelberg (1998)

    MATH  Google Scholar 

  9. Peyton Jones, S. (ed.): Haskell 1998 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  10. Loos, R., Weispfenning, V.: Applying linear quantifier elimination. Comput. J. 36(5), 450–462 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  11. Chin, W.N., Takano, A., Hu, Z.: Parallelization via context preservation. In: Proceedings of the 1998 International Conference on Computer Languages, pp. 153–162. IEEE Computer Society, Los Alamitos (1998)

    Google Scholar 

  12. Launchbury, J., Sheard, T.: Warm fusion: Deriving build-cata’s from recursive definitions. In: Conference Record of FPCA 1995 SIGPLAN-SIGARCH-WG2.8 Conference on Functional Programming Languages and Computer Architecture, pp. 314–323. ACM, New York (1995)

    Google Scholar 

  13. Hu, Z., Iwasaki, H., Takeichi, M.: Deriving structural hylomorphisms from recursive definitions. In: Proceedings of the 1996 ACM SIGPLAN International Conference on Functional Programming, pp. 73–82. ACM, New York (1996)

    Chapter  Google Scholar 

  14. Cole, M.: Parallel programming, list homomorphisms and the maximum segment sum problem. In: Parallel Computing: Trends and Applications, PARCO 1993, pp. 489–492. Elsevier, Amsterdam (1994)

    Google Scholar 

  15. Abrahamson, K.R., Dadoun, N., Kirkpatrick, D.G., Przytycka, T.M.: A simple parallel tree contraction algorithm. J. Algorithms 10(2), 287–302 (1989)

    Article  MATH  MathSciNet  Google Scholar 

  16. Reif, J.H. (ed.): Synthesis of Parallel Algorithms. Morgan Kaufmann Publishers, San Francisco (1993)

    Google Scholar 

  17. Morihata, A., Matsuzaki, K.: A tree contraction algorithm on non-binary trees. Technical Report METR 2008-27, Department of Mathematical Informatics, University of Tokyo (2008)

    Google Scholar 

  18. Hu, Z., Takeichi, M., Iwasaki, H.: Diffusion: Calculating efficient parallel programs. In: Proceedings of the 1999 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pp. 85–94. ACM, New York (1999)

    Google Scholar 

  19. Matsuzaki, K., Hu, Z., Takeichi, M.: Parallelization with tree skeletons. In: Kosch, H., Böszörményi, L., Hellwagner, H. (eds.) Euro-Par 2003. LNCS, vol. 2790, pp. 789–798. Springer, Heidelberg (2003)

    Google Scholar 

  20. Blelloch, G.E.: Scans as primitive parallel operations. IEEE Trans. Computers 38(11), 1526–1538 (1989)

    Article  Google Scholar 

  21. Gibbons, J., Cai, W., Skillicorn, D.B.: Efficient parallel algorithms for tree accumulations. Science of Computer Programming 23(1), 1–18 (1994)

    Article  MATH  MathSciNet  Google Scholar 

  22. Hu, Z., Iwasaki, H., Takeichi, M., Takano, A.: Tupling calculation eliminates multiple data traversals. In: Proceedings of the 2nd ACM SIGPLAN International Conference on Functional Programming, pp. 164–175. ACM, New York (1997)

    Chapter  Google Scholar 

  23. Chin, W.N., Khoo, S.C., Jones, N.: Redundant call elimination via tupling. Fundam. Inform. 69(1-2), 1–37 (2006)

    MATH  MathSciNet  Google Scholar 

  24. Hu, Z., Iwasaki, H., Takechi, M.: Formal derivation of efficient parallel programs by construction of list homomorphisms. ACM Trans. Program. Lang. Syst. 19(3), 444–461 (1997)

    Article  Google Scholar 

  25. Chin, W.N., Khoo, S.C., Hu, Z., Takeichi, M.: Deriving parallel codes via invariants. In: Palsberg, J. (ed.) SAS 2000. LNCS, vol. 1824, pp. 75–94. Springer, Heidelberg (2000)

    Google Scholar 

  26. Morihata, A., Matsuzaki, K., Hu, Z., Takeichi, M.: The third homomorphism theorem on trees: Downward & upward lead to divide-and-conquer. In: Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 177–185. ACM, New York (2009)

    Google Scholar 

  27. Dolzmann, A., Sturm, T.: Simplification of quantifier-free formulae over ordered fields. J. Symb. Comput. 24(2), 209–231 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  28. Chapman, B., Jost, G., der Pas, R.V.: Using OpenMP: Portable shared memory parallel programming. MIT Press, Cambridge (2007)

    Google Scholar 

  29. Callahan, D.: Recognizing and parallelizing bounded recurrences. In: Banerjee, U., Nicolau, A., Gelernter, D., Padua, D.A. (eds.) LCPC 1991. LNCS, vol. 589, pp. 169–185. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  30. Nishimura, S., Ohori, A.: Parallel functional programming on recursively defined data via data-parallel recursion. J. Funct. Program. 9(4), 427–462 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  31. Weispfenning, V.: Mixed real-integer linear quantifier elimination. In: Proceedings of the 1999 International Symposium on Symbolic and Algebraic Computation, pp. 129–136. ACM, New York (1999)

    Chapter  Google Scholar 

  32. Sturm, T., Weispfenning, V.: Quantifier elimination in term algebras: The case of finite languages. In: Proceedings of the Fifth International Workshop on Computer Algebra in Scientific Computing, pp. 285–300. Technische Universität München (2002)

    Google Scholar 

  33. Jiang, J.H.R.: Quantifier elimination via functional composition. In: Bouajjani, A., Maler, O. (eds.) CAV 2009. LNCS, vol. 5643, pp. 383–397. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  34. Keller, G., Chakravarty, M.M.T.: Flattening trees. In: Pritchard, D., Reeve, J.S. (eds.) Euro-Par 1998. LNCS, vol. 1470, pp. 709–719. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Morihata, A., Matsuzaki, K. (2010). Automatic Parallelization of Recursive Functions Using Quantifier Elimination. In: Blume, M., Kobayashi, N., Vidal, G. (eds) Functional and Logic Programming. FLOPS 2010. Lecture Notes in Computer Science, vol 6009. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-12251-4_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-12251-4_23

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-12250-7

  • Online ISBN: 978-3-642-12251-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics