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.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
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)
Größlinger, A., Griebl, M., Lengauer, C.: Quantifier elimination in automatic loop parallelization. Journal of Symbolic Computation 41(11), 1206–1221 (2006)
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)
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)
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)
Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, 2nd edn. Addison-Wesley, Reading (2006)
Caviness, B.F., Johnson, J.R. (eds.): Quantifier Elimination and Cylindrical Algebraic Decomposition. Springer, Heidelberg (1998)
Peyton Jones, S. (ed.): Haskell 1998 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge (2003)
Loos, R., Weispfenning, V.: Applying linear quantifier elimination. Comput. J. 36(5), 450–462 (1993)
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)
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)
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)
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)
Abrahamson, K.R., Dadoun, N., Kirkpatrick, D.G., Przytycka, T.M.: A simple parallel tree contraction algorithm. J. Algorithms 10(2), 287–302 (1989)
Reif, J.H. (ed.): Synthesis of Parallel Algorithms. Morgan Kaufmann Publishers, San Francisco (1993)
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)
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)
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)
Blelloch, G.E.: Scans as primitive parallel operations. IEEE Trans. Computers 38(11), 1526–1538 (1989)
Gibbons, J., Cai, W., Skillicorn, D.B.: Efficient parallel algorithms for tree accumulations. Science of Computer Programming 23(1), 1–18 (1994)
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)
Chin, W.N., Khoo, S.C., Jones, N.: Redundant call elimination via tupling. Fundam. Inform. 69(1-2), 1–37 (2006)
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)
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)
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)
Dolzmann, A., Sturm, T.: Simplification of quantifier-free formulae over ordered fields. J. Symb. Comput. 24(2), 209–231 (1997)
Chapman, B., Jost, G., der Pas, R.V.: Using OpenMP: Portable shared memory parallel programming. MIT Press, Cambridge (2007)
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)
Nishimura, S., Ohori, A.: Parallel functional programming on recursively defined data via data-parallel recursion. J. Funct. Program. 9(4), 427–462 (1999)
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)
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)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)