Skip to main content

A Case Study: Effects of With-Loop-Folding on the NAS Benchmark MG in Sac

  • Conference paper
  • First Online:
Implementation of Functional Languages (IFL 1998)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1595))

Included in the following conference series:

Abstract

Sac is a functional C variant with e cient support for highlevel array operations. This paper investigates the applicability of a Sac specific optimization technique called WITH-loop-folding to real world applications. As an example program which originates from the Numerical Aerodynamic Simulation (NAS) Program developed at NASA Ames Research Center, the so-called NAS benchmark MG is chosen. It comprises a kernel from the NAS Program which implements 3-dimensional multigrid relaxation.

Several run-time measurements exploit two different benefits of withloop-folding: First, an overall speed-up of about 20% can be observed. Second, a comparison between the run-times of a hand-optimized specification and of Apl-like specifications yields identical run-times, although a naive compilation that does not apply With-loop-folding leads to slowdowns of more than an order of magnitude. Furthermore, With-loopfolding makes a slight variation of the algorithm feasible which substantially simplifies the program specification and requires less memory during execution.

Finally, the optimized run-times are compared against run-times gained from the original Fortran program, which shows that for different problem sizes, the code generated from the Sac program does not only reach the execution times of the code generated from the Fortran program but even outperforms them by about 10%.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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.

Similar content being viewed by others

References

  1. J.C. Adams, W.S. Brainerd, J.T. Martin, et al. Fortran90 Handbook-Complete ANSI/ISO Reference. McGraw-Hill, 1992. ISBN 0-07-000406-4.

    Google Scholar 

  2. D.F. Bacon, S.L. Graham, and O.J. Sharp. Compiler Transformations for High-Performance Computing. ACM Computing Surveys, 26(4):345–420, 1994.

    Article  Google Scholar 

  3. D. Bailey, E. Barszcz, J. Barton, et al. The NAS Parallel Benchmarks. RNR 94-007, NASA Ames Research Center, 1994.

    Google Scholar 

  4. D. Braess. Finite Elemente. Springer, 1996. ISBN 3-540-61905-4.

    Google Scholar 

  5. A. Brandt. Multigrid Methods: 1984 Guide. Dept of applied mathematics, The Weizmann Institute of Science, Rehovot/Israel, 1984.

    MATH  Google Scholar 

  6. T. Budd. Composition and Compilation in Functional Programming Languages. Technical Report 88-60-14, Oregon State University, 1988.

    Google Scholar 

  7. C. Burke. J and APL. Iverson Software Inc., Toronto, Canada, 1996.

    Google Scholar 

  8. D.C. Cann. The Optimizing SISAL Compiler: Version 12.0. Lawrence Livermore National Laboratory, LLNL, Livermore California, 1993. part of the SISAL distribution.

    Google Scholar 

  9. W.-N. Chin. Safe Fusion of Functional Expressions II: Further Improvements. Journal of Functional Programming, 4(4):515–550, 1994.

    Article  Google Scholar 

  10. High Performance Fortran Forum. High Performance Fortran language specification V1.1, 1994.

    Google Scholar 

  11. A. Gill. Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Glasgow University, 1996.

    Google Scholar 

  12. J. Halen, P. Hammarlund, and B. Lisper. An Experimental Implementation of a Highly Abstract Model of Data Parallel Programming. TRITA-IT 97:2, Dept. of Teleinformatics, KTH, Stockholm, 1997.

    Google Scholar 

  13. P. Hammarlund and B. Lisper. On the Relation between Functional and Data Parallel Programming Languages. In Proc. 1993 ACM Conference on Functional Programming Languages and Computer Architecture (FPLCA’93), pages 210–222. ACM Press, 1993.

    Google Scholar 

  14. K.E. Iverson. A Programming Language. Wiley, New York, 1962.

    Google Scholar 

  15. M.A. Jenkins and W.H. Jenkins. The Q’Nial Language and Reference Manuals. Nial Systems Ltd., Ottawa, Canada, 1993.

    Google Scholar 

  16. E.C. Lewis, C. Lin, and L. Snyder. The Implementation and Evaluation of Fusion and Contraction in Array Languages. In Proc. 1998 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’ 98). 1998.

    Google Scholar 

  17. C. Lin. ZPL Language Reference Manual. UW-CSE-TR 94-10-06, University of Washington, 1996.

    Google Scholar 

  18. J.R. McGraw, S.K. Skedzielewski, S.J. Allan, R.R. Oldehoeft, et al. Sisal: Streams and Iteration in a Single Assignment Language: Reference Manual Version 1.2. M 146, Lawrence Livermore National Laboratory, LLNL, Livermore California, 1985.

    Google Scholar 

  19. L. Nemeth and S. Peyton Jones. A Design for Warm Fusion. In K. Hammond, A.J.T. Davie, and C. Clack, editors, Draft Proc. 10th. International Workshop on Implementation of Functional Languages (IFL’ 98), London, England, pages 381–393. University College, London, 1998.

    Google Scholar 

  20. G. Roth and K. Kennedy. Loop Fusion in High Performance Fortran. CRPC TR98745, Rice University, Houston, Texas, 1998.

    Google Scholar 

  21. S.-B. Scholz. S ingle A ssignment C-Entwurf und Implementierung einer funktionalen C-Variante mit spezieller Unterstützung shape-invarianter Array-Operationen. PhD thesis, Institut für Informatik und Praktische Mathematik, Universität Kiel, 1996.

    Google Scholar 

  22. S.-B. Scholz. On Programming Scientific Applications in Sac-A Functional Language Extended by a Subsystem for High-Level Array Operations. In W. Kluge, editor, Proc. 8th. International Workshop on the Implementation of Functional Languages (IFL’96), Bad Godesberg, Germany, September 1996, volume 1268 of LNCS, pages 85–104. Springer-Verlag, 1997.

    Google Scholar 

  23. S.-B. Scholz. With-loop-folding in Sac-Condensing Consecutive Array Operations. In C. Clack, T. Davie, and K. Hammond, editors, Proc. 9th. International Workshop on Implementation of Functional Languages, St Andrews, Scotland, September 1997, volume 1467 of LNCS, pages 72–91. Springer-Verlag, 1998.

    Google Scholar 

  24. S.-B. Scholz. On Defining Application-Specific High-Level Operations by Means of Shape-Invariant Programming Facilities. In S. Picchi and M. Micocci, editors, Proc. Array Processing Language Conference 98, pages 40–45. ACM-SIGAPL, 1998.

    Google Scholar 

  25. P.L. Wadler. Deforestation: transforming programs to eliminate trees. Theoretical Computer Science, 73(2):231–248, 1990.

    Article  MATH  MathSciNet  Google Scholar 

  26. M.J. Wolfe. High-Performance Compilers for Parallel Computing. Addison-Wesley, 1995. ISBN 0-8053-2730-4.

    Google Scholar 

  27. H. Zima and B. Chapman. Supercompilers for Parallel and Vector Computers. Addison-Wesley, 1991.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Scholz, SB. (1999). A Case Study: Effects of With-Loop-Folding on the NAS Benchmark MG in Sac . In: Hammond, K., Davie, T., Clack, C. (eds) Implementation of Functional Languages. IFL 1998. Lecture Notes in Computer Science, vol 1595. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48515-5_14

Download citation

  • DOI: https://doi.org/10.1007/3-540-48515-5_14

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66229-7

  • Online ISBN: 978-3-540-48515-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics