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%.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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.
D.F. Bacon, S.L. Graham, and O.J. Sharp. Compiler Transformations for High-Performance Computing. ACM Computing Surveys, 26(4):345–420, 1994.
D. Bailey, E. Barszcz, J. Barton, et al. The NAS Parallel Benchmarks. RNR 94-007, NASA Ames Research Center, 1994.
D. Braess. Finite Elemente. Springer, 1996. ISBN 3-540-61905-4.
A. Brandt. Multigrid Methods: 1984 Guide. Dept of applied mathematics, The Weizmann Institute of Science, Rehovot/Israel, 1984.
T. Budd. Composition and Compilation in Functional Programming Languages. Technical Report 88-60-14, Oregon State University, 1988.
C. Burke. J and APL. Iverson Software Inc., Toronto, Canada, 1996.
D.C. Cann. The Optimizing SISAL Compiler: Version 12.0. Lawrence Livermore National Laboratory, LLNL, Livermore California, 1993. part of the SISAL distribution.
W.-N. Chin. Safe Fusion of Functional Expressions II: Further Improvements. Journal of Functional Programming, 4(4):515–550, 1994.
High Performance Fortran Forum. High Performance Fortran language specification V1.1, 1994.
A. Gill. Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Glasgow University, 1996.
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.
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.
K.E. Iverson. A Programming Language. Wiley, New York, 1962.
M.A. Jenkins and W.H. Jenkins. The Q’Nial Language and Reference Manuals. Nial Systems Ltd., Ottawa, Canada, 1993.
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.
C. Lin. ZPL Language Reference Manual. UW-CSE-TR 94-10-06, University of Washington, 1996.
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.
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.
G. Roth and K. Kennedy. Loop Fusion in High Performance Fortran. CRPC TR98745, Rice University, Houston, Texas, 1998.
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.
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.
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.
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.
P.L. Wadler. Deforestation: transforming programs to eliminate trees. Theoretical Computer Science, 73(2):231–248, 1990.
M.J. Wolfe. High-Performance Compilers for Parallel Computing. Addison-Wesley, 1995. ISBN 0-8053-2730-4.
H. Zima and B. Chapman. Supercompilers for Parallel and Vector Computers. Addison-Wesley, 1991.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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