skip to main content
research-article

On Automated Memoization in the Field of Simulation Parameter Studies

Authors Info & Claims
Published:24 September 2018Publication History
Skip Abstract Section

Abstract

Processes in computer simulations tend to be highly repetitive. In particular, parameter studies further exasperate the situation as the same model is repeatedly executed with only partially varying parameters. Consequently, computer simulations perform identical computations, with identical code, identical input, and hence identical output. These redundant computations waste significant amounts of time and energy.

Memoization, dating back to 1968, enables the caching of such identical intermediate results, thereby significantly speeding up those computations. However, until now, automated approaches were limited to pure functions. At ACM SIGSIM-PADS 2016 we published, to the best of our knowledge, the first practical approach for automated memoization for impure code. In this work, we extend this approach and evaluate the performance characteristics of a number of extensions that deal with questions posed at PADS: (1) To reduce and bound the memory footprint, we investigate several cache eviction strategies. (2) We allow the original and the memoized code to coexist via a runtime-switch and analyze the crossover point, thereby mitigating memoization overhead. (3) By optionally persisting the Memoization Cache to disk, we expand the scope to exploratory parameter studies where cached results can now be reused across multiple simulation runs.

Altogether, automated memoization for impure code is a valuable technique, the versatility of which we explore further in this article. It sped up a case study of an OFDM network simulation by a factor of more than 80 with an only marginal increase of memory consumption.

Skip Supplemental Material Section

Supplemental Material

References

  1. Umut A. Acar. 2009. Self-adjusting computation: (An overview). In Proceedings of the 2009 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation. 1--6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Umut A. Acar, Amal Ahmed, and Matthias Blume. 2008. Imperative self-adjusting computation. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 309--322. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Roger Arditi and Lev R. Ginzburg. 1989. Coupling in predator-prey dynamics: Ratio-dependence. J. Theoret. Biol. 139, 3 (1989), 311--326.Google ScholarGoogle ScholarCross RefCross Ref
  4. Davide Cingolani, Alessandro Pellegrini, and Francesco Quaglia. 2015. Transparently mixing undo logs and software reversibility for state recovery in optimistic PDES. In Proceedings of the 3rd ACM SIGSIM Conference on Principles of Advanced Discrete Simulation. 211--222. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Steve Ferenci, Richard Fujimoto, Mostafa Ammar, Kalyan Perumalla, and George Riley. 2002. Updateable simulation of communication networks. In Proceedings of the 16th Workshop on Parallel and Distributed Simulation. 107--114. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Harald Friis. 1946. A note on a simple transmission formula. Proc. Inst. Radio Eng. 34, 5 (1946), 254--256.Google ScholarGoogle ScholarCross RefCross Ref
  7. Marty Hall and James Mayfield. 1993. Improving the performance of AI software: Payoffs and pitfalls in using automatic memoization. In Proceedings of the 6th International Symposium on Artificial Intelligence.Google ScholarGoogle Scholar
  8. Thomas Henderson, Sumit Roy, Sally Floyd, and George Riley. 2006. ns-3 project goals. In Proceedings of the 1st Workshop on ns-2: The IP Network Simulator. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Ralf Hinze. 2000. Memo functions, polytypically! In Proceedings of the 2nd Workshop on Generic Programming. 17--32.Google ScholarGoogle Scholar
  10. Maria Hybinette and Richard Fujimoto. 1997. Cloning: A novel method for interactive parallel simulation. In Proceedings of the 29th Winter Simulation Conference. 444--451. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Maria Hybinette and Richard Fujimoto. 2001. Cloning parallel simulations. ACM Trans. Model. Comput. Simul. 11, 4 (2001), 378--407. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. ISO. 2014. ISO/IEC 14882:2014 Information Technology — Programming Languages — C++. International Organization for Standardization, Geneva, Switzerland. 1358 pages.Google ScholarGoogle Scholar
  13. Kazutaka Kamimura, Ryosuke Oda, Tatsuhiro Yamada, Tomoaki Tsumura, Hiroshi Matsuo, and Yasuhiko Nakashima. 2012. A speed-up technique for an auto-memoization processor by reusing partial results of instruction regions. In Proceedings of the 3rd International Conference on Networking and Computing. 49--57. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. William Landi. 1992. Undecidability of static analysis. ACM Lett. Prog. Lang. Syst. 1, 4 (1992), 323--337. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Pierre L’Ecuyer. 1999. Good parameters and implementations for combined multiple recursive random number generators. Operat. Res. 47, 1 (1999), 159--164. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Makoto Matsumoto and Takuji Nishimura. 1998. Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator. ACM Trans. Model. Comput. Simul. 8, 1 (1998), 3--30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. James Mayfield, Tim Finin, and Marty Hall. 1995. Using automatic memoization as a software engineering tool in real-world AI systems. In Proceedings of the 11th Conference on Artificial Intelligence for Applications. 87--93. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Paul McNamee and Marty Hall. 1998. Developing a tool for memoizing functions in C++. ACM SIGPLAN Not. 33, 8 (1998), 17--22. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Donald Michie. 1967. Memo Functions: A Language Feature with “Rote-Learning” Properties. Technical Report. Edinburgh University, Dept. of Machine Intelligence and Perception.Google ScholarGoogle Scholar
  20. Donald Michie. 1968. Memo functions and machine learning. Nature 218, 5136 (1968), 19--22.Google ScholarGoogle Scholar
  21. Jack Mostow and Donald Cohen. 1985. Automating program speedup by deciding what to cache. In Proceedings of the 9th International Joint Conference on Artificial Intelligence. 165--172. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Peter Norvig. 1991. Techniques for automatic memoization with applications to context-free parsing. Computational Linguistics 17, 1 (1991), 91--98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Robin Popplestone. 1967. Memo Functions and the POP-2 Language. Technical Report. Edinburgh University, Dept. of Machine Intelligence and Perception.Google ScholarGoogle Scholar
  24. Robert Rönngren, Michael Liljenstam, and Johan Montagnat. 1996. Transparent incremental state saving in time warp PDES. In Proceedings of the 10th Workshop on Parallel and Distributed Simulation. 70--77. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Markus Schordan, Thomas Oppelstrup, David Jefferson, and Peter Barnes. 2016. Automatic generation of reversible C++ code and its performance in a scalable kinetic Monte-Carlo application. In Proceedings of the 4th ACM SIGSIM Conference on Principles of Advanced Discrete Simulation. 111--122. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Christoph Sommer. 2017. Veins. (23 June 2017). veins.car2x.org, retrieved Aug 17, 2017.Google ScholarGoogle Scholar
  27. Christoph Sommer, Reinhard German, and Falko Dressler. 2011. Bidirectionally coupled network and road traffic simulation for improved IVC analysis. IEEE Trans. Mobile Comput. 10, 1 (2011), 3--15. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Mirko Stoffers, Ralf Bettermann, and Klaus Wehrle. 2017. Automated memoization: Automatically identifying memoization units in simulation parameter studies. In Proceedings of the 21st IEEE/ACM International Symposium on Distributed Simulation and Real Time Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Mirko Stoffers, Daniel Schemmel, Oscar Soria Dustmann, and Klaus Wehrle. 2016. Automated memoization for parameter studies implemented in impure languages. In Proceedings of the 4th ACM SIGSIM Conference on Principles of Advanced Discrete Simulation. 221--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tomoaki Tsumura, Ikuma Suzuki, Yasuki Ikeuchi, Hiroshi Matsuo, Hiroshi Nakashima, and Yasuhiko Nakashima. 2007. Design and evaluation of an auto-memoization processor. In Proceedings of the 25th International Multi-Conference on Parallel and Distributed Computing and Networks. 230--235. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Andràs Varga. 2001. The OMNeT++ discrete event simulation system. In Proceedings of the 15th European Simulation MC.Google ScholarGoogle Scholar
  32. Roberto Vitali, Alessandro Pellegrini, and Francesco Quaglia. 2010. Autonomic Log/restore for advanced optimistic simulation systems. In Proceedings of the 18th Symposium on Modeling, Analysis and Simulation of Comp. and Telecommunication Systems. 319--327. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Cheng-Xiang Wang, Matthias Pätzold, and Qi Yao. 2007. Stochastic modeling and simulation of frequency-correlated wideband fading channels. IEEE Trans. Vehic. Tech. 56, 3 (2007), 1050--1063.Google ScholarGoogle ScholarCross RefCross Ref
  34. Darrin West and Kiran Panesar. 1996. Automatic incremental state saving. In Proceedings of the 10th Workshop on Parallel and Distributed Simulation. 78--85. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Neng-Fa Zhou and Taisuke Sato. 2003. Efficient fixpoint computation in linear tabling. In Proceedings of the 5th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming. 275--283. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. On Automated Memoization in the Field of Simulation Parameter Studies

      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

      • Published in

        cover image ACM Transactions on Modeling and Computer Simulation
        ACM Transactions on Modeling and Computer Simulation  Volume 28, Issue 4
        Special Issue on PADS 2016
        October 2018
        125 pages
        ISSN:1049-3301
        EISSN:1558-1195
        DOI:10.1145/3274766
        Issue’s Table of Contents

        Copyright © 2018 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 24 September 2018
        • Accepted: 1 February 2018
        • Revised: 1 August 2017
        • Received: 1 November 2016
        Published in tomacs Volume 28, Issue 4

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader