skip to main content
research-article

Stack safe parallel recursion with paraffin

Published:06 November 2011Publication History
Skip Abstract Section

Abstract

Recursion is a programming technique in which a solution can be expressed by a subroutine invoking itself either directly or indirectly. Many problems can be expressed simply using a recursive approach, however one of the drawbacks of using recursion is that it requires a stack, and often one does not know how much stack space is needed to obtain a recursive result. Stack overflow often results in spectacular failure with strange, often unrepeatable behaviour. Paraffin is a suite of generic units that can add parallelism to iterative and recursive problems. Some of the generics involve a load balancing technique described as "work-seeking". It was found that the recursive work seeking algorithm could be extended to also provide stack safety whereby the generics monitor the amount of remaining stack space and avoid stack overflow using a technique similar to load balancing. The stack safety feature also makes it attractive to consider Paraffin for use with code destined for execution on a single core. This paper describes how the recursive work-seeking algorithm was extended to provide the stack-safety feature, and then goes on to report some performance results using the generics.

References

  1. Moore B., Paraffin, http://sourceforge.net/projects/paraffin/ (Sept 2011)Google ScholarGoogle Scholar
  2. Moore B., Parallelism Generics for Ada 2005 and Beyond, ACM SIGAda '10 (2010) Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Moore B., A comparison of work-sharing, work-seeking, and work-stealing parallelism strategies using Paraffin with Ada 2005. Ada User Journal Volume 32, Number 1, March 2011Google ScholarGoogle Scholar
  4. Fox, G., Williams, R., Messina G., Parallel Computing Works!, ISBN 1--55860--253--4 Morgan Kaufmann Publishers, Inc. 1994Google ScholarGoogle Scholar
  5. Taft, S.T., Duff, R. A., Brukardt, R.L. And Plödereder, E. Eds (2000). Consolidated Ada Reference Manual. LNCS 2219, Springer-Verlag Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Walker J., Red Black Trees, http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_rbtree.aspx (Aug 2010)Google ScholarGoogle Scholar
  7. Frigo M., Halpern P., Leiserson C., and Lewin- Berlin S., Reducers and Other Cilk++ Hyperobjects. ACM SPAA '09 (2009) Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Burns, A., Wellings A., Concurrent and Real-Time Programming in Ada, Cambridge University Press, 2007 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Barney Blaise, Lawrence Livermore National Laboratory, https://computing.llnl.gov/tutorials/openMP/#WorkSharing (Sept 2010)Google ScholarGoogle Scholar

Index Terms

  1. Stack safe parallel recursion with paraffin

                  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

                  • Article Metrics

                    • Downloads (Last 12 months)2
                    • Downloads (Last 6 weeks)0

                    Other Metrics

                  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!