Skip to main content

With-Loop Scalarization – Merging Nested Array Operations

  • Conference paper
Implementation of Functional Languages (IFL 2003)

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

Included in the following conference series:

Abstract

Construction of complex array operations by composition of more basic ones allows for abstract and concise specifications of algorithms. Unfortunately, naïve compilation of such specifications leads to creation of many temporary arrays at runtime and, consequently, to poor performance characteristics.

This paper elaborates on a new compiler optimization, named with-loop-scalarization, which aims at eliminating temporary arrays in the context of nested array operations. It is based on with-loops, a versatile array comprehension construct used by the functional array language SaC both for specification as well as for internal representation of array operations.

The impact of with-loop-scalarization on the runtime performance of compiled SaC code is demonstrated by several experiments involving support for arithmetic on arrays of complex numbers and the application kernel FT from the NAS benchmark suite.

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

Access this chapter

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.

References

  1. Abrams, P.S.: An APL Machine. SLAC 114, Stanford Linear Accelerator Center (1970)

    Google Scholar 

  2. Anderson, S., Hudak, P.: Compilation of Haskell Array Comprehensions for Scientific Computing. In: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 1990), White Plains, New York, USA. SIGPLAN Notices, vol. 25, pp. 137–149. ACM Press, New York (1990)

    Chapter  Google Scholar 

  3. Bailey, D.H., Barszcz, E., Barton, J.T., Browning, D.S., Carter, R.L., Dagum, L., Fatoohi, R.A., Frederickson, P.O., Lasinski, T.A., Schreiber, T.A., Simon, R.S., Venkatakrishnam, V., Weeratunga, S.K.: The NAS Parallel Benchmarks. International Journal of Supercomputer Applications 5(3), 63–73 (1991)

    Article  Google Scholar 

  4. Bernecky, R.: APEX: The APL Parallel Executor. Master’s thesis, University of Toronto, Toronto, Canada (1997)

    Google Scholar 

  5. Blelloch, G.E.: NESL: A Nested Data-Parallel Language (Version 3.1). Technical Report CMU-CS-95-170, Carnegie Mellon University, Pittsburgh, Pennsylvania, USA (1995)

    Google Scholar 

  6. Blelloch, G.E., Sabot, G.W.: Compiling Collection-Oriented Languages onto Massively Parallel Computers. Journal of Parallel and Distributed Computing 8(2), 119–134 (1990)

    Article  Google Scholar 

  7. Budd, T.: An APL Compiler. Springer, Berlin (1988)

    MATH  Google Scholar 

  8. Chakravarty, M.M.T., Keller, G.: Functional Array Fusion. In: Proceedings of the 6th ACM SIGPLAN International Conference on Functional Programming (ICFP 2001), Florence, Italy, pp. 205–216. ACM Press, New York (2001)

    Chapter  Google Scholar 

  9. Chakravarty, M.M.T., Keller, G.: An Approach to Fast Arrays in Haskell. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, pp. 27–58. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  10. Chamberlain, B.L., Choi, S.-E., Lewis, C., Snyder, L., Weathersby, W.D., Lin, C.: The Case for High-Level Parallel Programming in ZPL. IEEE Computational Science and Engineering 5(3) (1998)

    Google Scholar 

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

    Article  Google Scholar 

  12. Gill, A.: Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Glasgow University, Glasgow, Scotland, UK (1996)

    Google Scholar 

  13. Gill, A., Launchbury, J., Peyton Jones, S.L.: A Short Cut to Deforestation. In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture (FPCA 1993), Copenhagen, Denmark, pp. 223–232. ACM Press, New York (1993)

    Chapter  Google Scholar 

  14. Grelck, C.: Implementing the NAS Benchmark MG in SAC. In: Proceedings of the 16th International Parallel and Distributed Processing Symposium (IPDPS 2002), Fort Lauderdale, Florida, USA, IEEE Computer Society Press, Los Alamitos (2002)

    Google Scholar 

  15. Grelck, C., Kreye, D., Scholz, S.-B.: On Code Generation for Multi-Generator WITH-Loops in SAC. In: Koopman, P., Clack, C. (eds.) IFL 1999. LNCS, vol. 1868, pp. 77–94. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  16. Grelck, C., Scholz, S.-B.: Axis Control in SAC. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, pp. 182–198. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  17. Grelck, C., Scholz, S.-B.: Towards an Efficient Functional Implementation of the NAS Benchmark FT. In: Malyshkin, V.E. (ed.) PaCT 2003. LNCS, vol. 2763, pp. 230–235. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  18. Hammes, J., Sur, S., Böhm, W.: On the Effectiveness of Functional Language Features: NAS Benchmark FT. Journal of Functional Programming 7(1), 103–123 (1997)

    Article  MATH  Google Scholar 

  19. International Standards Organization. Programming Language APL, Extended. ISO N93.03, ISO (1993)

    Google Scholar 

  20. Iverson, K.E.: J. Introduction and Dictionary. Iverson Software Inc., Toronto, Canada (1995)

    Google Scholar 

  21. Jenkins, M.A., Jenkins, W.H.: The Q’Nial Language and Reference Manual. Nial Systems Ltd., Ottawa (1993)

    Google Scholar 

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

    Google Scholar 

  23. Oldehoeft, R.R.: Implementing Arrays in SISAL 2.0. In: Proceedings of the 2nd SISAL Users Conference, San Diego, California, USA, pp. 209–222. Lawrence Livermore National Laboratory (1992)

    Google Scholar 

  24. Scholz, S.-B.: With-loop-folding in SAC — Condensing Consecutive Array Operations. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1997. LNCS, vol. 1467, pp. 72–92. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  25. Scholz, S.-B.: A Case Study: Effects of WITH-Loop Folding on the NAS Benchmark MG in SAC. In: Hammond, K., Davie, T., Clack, C. (eds.) IFL 1998. LNCS, vol. 1595, pp. 216–228. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  26. Scholz, S.-B.: Single Assignment C — Efficient Support for High-Level Array Operations in a Functional Setting. Journal of Functional Programming 13(6), 1005–1059 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  27. van Arkel, D., van Groningen, J., Smetsers, S.: Fusion in Practice. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, pp. 51–67. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  28. van Groningen, J.: The Implementation and Efficiency of Arrays in Clean 1.1. In: Kluge, W.E. (ed.) IFL 1996. LNCS, vol. 1268, pp. 105–124. Springer, Heidelberg (1997)

    Google Scholar 

  29. Wadler, P.: Deforestation: Transforming Programs to Eliminate Trees. Theoretical Computer Science 73(2), 231–248 (1990)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Grelck, C., Scholz, SB., Trojahner, K. (2004). With-Loop Scalarization – Merging Nested Array Operations. In: Trinder, P., Michaelson, G.J., Peña, R. (eds) Implementation of Functional Languages. IFL 2003. Lecture Notes in Computer Science, vol 3145. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-27861-0_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-27861-0_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-23727-3

  • Online ISBN: 978-3-540-27861-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics