skip to main content
research-article

The third homomorphism theorem on trees: downward & upward lead to divide-and-conquer

Published:21 January 2009Publication History
Skip Abstract Section

Abstract

Parallel programs on lists have been intensively studied. It is well known that associativity provides a good characterization for divide-and-conquer parallel programs. In particular, the third homomorphism theorem is not only useful for systematic development of parallel programs on lists, but it is also suitable for automatic parallelization. The theorem states that if two sequential programs iterate the same list leftward and rightward, respectively, and compute the same value, then there exists a divide-and-conquer parallel program that computes the same value as the sequential programs.

While there have been many studies on lists, few have been done for characterizing and developing of parallel programs on trees. Naive divide-and-conquer programs, which divide a tree at the root and compute independent subtrees in parallel, take time that is proportional to the height of the input tree and have poor scalability with respect to the number of processors when the input tree is ill-balanced.

In this paper, we develop a method for systematically constructing scalable divide-and-conquer parallel programs on trees, in which two sequential programs lead to a scalable divide-andconquer parallel program. We focus on paths instead of trees so as to utilize rich results on lists and demonstrate that associativity provides good characterization for scalable divide-and-conquer parallel programs on trees. Moreover, we generalize the third homomorphism theorem from lists to trees.We demonstrate the effectiveness of our method with various examples. Our results, being generalizations of known results for lists, are generic in the sense that they work well for all polynomial data structures.

References

  1. Karl R. Abrahamson, N. Dadoun, David G. Kirkpatrick, and Teresa M. Przytycka. A simple parallel tree contraction algorithm. Journal of Algorithms, 10(2):287--302, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Roland Carl Backhouse, Patrik Jansson, Johan Jeuring, and Lambert G. L. T. Meertens. Generic programming: An introduction. In Advanced Functional Programming, pages 28--115, 1998.Google ScholarGoogle Scholar
  3. Richard S. Bird. An introduction to the theory of lists. In Logic of Programming and Calculi of Discrete Design, pages 3--42. Springer, 1987. NATO ASI Series F Volume 36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Wei-Ngan Chin. Towards an automated tupling strategy. In Proceedings of the ACM SIGPLAN symposium on Partial evaluation and semanticsbased program manipulation, PEPM'93, pages 119--132, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Murray Cole. Parallel programming, list homomorphisms and the maximum segment sum problem. In Parallel Computing: Trends and Applications, PARCO 1993, Grenoble, France, pages 489--492. Elsevier, 1994.Google ScholarGoogle Scholar
  6. Murray Cole. Parallel programming with list homomorphisms. Parallel Processing Letters, 5:191--203, 1995.Google ScholarGoogle ScholarCross RefCross Ref
  7. Richard Cole and Uzi Vishkin. The accelerated centroid decomposition technique for optimal parallel tree evaluation in logarithmic time. Algorithmica, 3:329--346, 1988.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Maarten M. Fokkinga. Tupling and mutumorphisms. In Squiggolist, volume 1(4), 1989.Google ScholarGoogle Scholar
  9. Ian Foster. Designing and Building Parallel Programs. Addison Wesley, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Alfons Geser and Sergei Gorlatch. Parallelizing functional programs by generalization. Journal of Functional Programming, 9(6):649--673, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Alan Gibbons and Wojciech Rytter. Optimal parallel algorithm for dynamic expression evaluation and context-free recognition. Information and Computation, 81(1):32--45, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Jeremy Gibbons. The third homomorphism theorem. Journal of Functional Programming, 6(4):657--665, 1996.Google ScholarGoogle ScholarCross RefCross Ref
  13. Jeremy Gibbons, Wentong Cai, and David B. Skillicorn. Efficient parallel algorithms for tree accumulations. Science of Computer Programming, 23(1):1--18, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Zhenjiang Hu, Hideya Iwasaki, and Masato Takeichi. Formal derivation of efficient parallel programs by construction of list homomorphisms. ACM Transactions on Programming Languages and Systems, 19(3):444--461, 1997a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Zhenjiang Hu, Hideya Iwasaki, Masato Takeichi, and Akihiko Takano. Tupling calculation eliminates multiple data traversals. In Proceedings of the 2nd ACM SIGPLAN International Conference on Functional Programming, ICFP'97, Amsterdam, The Netherlands, pages 164--175. 1997b. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Gèrard P. Huet. The zipper. Journal of Functional Programming, 7(5): 549--554, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Kiminori Matsuzaki. Parallel Programming with Tree Skeletons. PhD thesis, Graduate School of Information Science and Technology, The University of Tokyo, 2007.Google ScholarGoogle Scholar
  18. Kiminori Matsuzaki and Zhenjiang Hu. Implementation of tree skeletons on distributed-memory parallel computers. Technical Report METR 2006-65, Department of Mathematical Informatics, University of Tokyo, December 2006.Google ScholarGoogle Scholar
  19. Kiminori Matsuzaki, Zhenjiang Hu, and Masato Takeichi. Parallelization with tree skeletons. In Euro-Par 2003. Parallel Processing, 9th International Euro-Par Conference, Klagenfurt, Austria, August 26-29, 2003. Proceedings, volume 2790 of Lecture Notes in Computer Science, pages 789--798. Springer, 2003.Google ScholarGoogle Scholar
  20. Conor McBride. The derivative of a regular type is its type of one-hole contexts. Unpublished manuscript, 2001.Google ScholarGoogle Scholar
  21. Gary L. Miller and John H. Reif. Parallel tree contraction and its application. In 26th Annual Symposium on Foundations of Computer Science, 21-23 October 1985, Portland, Oregon, USA, pages 478--489. 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Akimasa Morihata and Kiminori Matsuzaki. A tree contraction algorithm on non-binary trees. Technical Report METR 2008-27, Department of Mathematical Informatics, University of Tokyo, 2008.Google ScholarGoogle Scholar
  23. Kazutaka Morita, Akimasa Morihata, Kiminori Matsuzaki, Zhenjiang Hu, and Masato Takeichi. Automatic inversion generates divide-and-conquer parallel programs. In Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation, San Diego, California, USA, June 10-13, 2007, pages 146--155, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Simon Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, 2003.Google ScholarGoogle Scholar
  25. John H. Reif, editor. Synthesis of Parallel Algorithms. Morgan Kaufmann Publishers, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. David B. Skillicorn. Parallel implementation of tree skeletons. Journal of Parallel and Distributied Computing, 39(2):115--125, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The third homomorphism theorem on trees: downward & upward lead to divide-and-conquer

        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

        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!