skip to main content
research-article

On Automated Memoization in the Field of Simulation Parameter Studies

Published: 24 September 2018 Publication History

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.

Supplementary Material

a26-stoffers-apndx.pdf (stoffers.zip)
Supplemental movie, appendix, image and software files for, On Automated Memoization in the Field of Simulation Parameter Studies

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.
[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.
[3]
Roger Arditi and Lev R. Ginzburg. 1989. Coupling in predator-prey dynamics: Ratio-dependence. J. Theoret. Biol. 139, 3 (1989), 311--326.
[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.
[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.
[6]
Harald Friis. 1946. A note on a simple transmission formula. Proc. Inst. Radio Eng. 34, 5 (1946), 254--256.
[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.
[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.
[9]
Ralf Hinze. 2000. Memo functions, polytypically! In Proceedings of the 2nd Workshop on Generic Programming. 17--32.
[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.
[11]
Maria Hybinette and Richard Fujimoto. 2001. Cloning parallel simulations. ACM Trans. Model. Comput. Simul. 11, 4 (2001), 378--407.
[12]
ISO. 2014. ISO/IEC 14882:2014 Information Technology — Programming Languages — C++. International Organization for Standardization, Geneva, Switzerland. 1358 pages.
[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.
[14]
William Landi. 1992. Undecidability of static analysis. ACM Lett. Prog. Lang. Syst. 1, 4 (1992), 323--337.
[15]
Pierre L’Ecuyer. 1999. Good parameters and implementations for combined multiple recursive random number generators. Operat. Res. 47, 1 (1999), 159--164.
[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.
[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.
[18]
Paul McNamee and Marty Hall. 1998. Developing a tool for memoizing functions in C++. ACM SIGPLAN Not. 33, 8 (1998), 17--22.
[19]
Donald Michie. 1967. Memo Functions: A Language Feature with “Rote-Learning” Properties. Technical Report. Edinburgh University, Dept. of Machine Intelligence and Perception.
[20]
Donald Michie. 1968. Memo functions and machine learning. Nature 218, 5136 (1968), 19--22.
[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.
[22]
Peter Norvig. 1991. Techniques for automatic memoization with applications to context-free parsing. Computational Linguistics 17, 1 (1991), 91--98.
[23]
Robin Popplestone. 1967. Memo Functions and the POP-2 Language. Technical Report. Edinburgh University, Dept. of Machine Intelligence and Perception.
[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.
[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.
[26]
Christoph Sommer. 2017. Veins. (23 June 2017). veins.car2x.org, retrieved Aug 17, 2017.
[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.
[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.
[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.
[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.
[31]
Andràs Varga. 2001. The OMNeT++ discrete event simulation system. In Proceedings of the 15th European Simulation MC.
[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.
[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.
[34]
Darrin West and Kiran Panesar. 1996. Automatic incremental state saving. In Proceedings of the 10th Workshop on Parallel and Distributed Simulation. 78--85.
[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.

Cited By

View all
  • (2024)The Essence of the Flyweight Design PatternProceedings of the Workshop Dedicated to Jens Palsberg on the Occasion of His 60th Birthday10.1145/3694848.3694855(30-38)Online publication date: 22-Oct-2024
  • (2024)Parallel Simulation of Quantum Networks with Distributed Quantum State ManagementACM Transactions on Modeling and Computer Simulation10.1145/363470134:2(1-28)Online publication date: 31-Jan-2024
  • (2022)Advanced TutorialProceedings of the Winter Simulation Conference10.5555/3586210.3586232(268-282)Online publication date: 11-Dec-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
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: 01 February 2018
Revised: 01 August 2017
Received: 01 November 2016
Published in TOMACS Volume 28, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Automatic memoization
  2. accelerating parameter studies
  3. impure languages

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

  • European Research Council under the EU's Horizon2020 Framework Programme/ERC
  • German Research Foundation (DFG)

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)5
  • Downloads (Last 6 weeks)1
Reflects downloads up to 05 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)The Essence of the Flyweight Design PatternProceedings of the Workshop Dedicated to Jens Palsberg on the Occasion of His 60th Birthday10.1145/3694848.3694855(30-38)Online publication date: 22-Oct-2024
  • (2024)Parallel Simulation of Quantum Networks with Distributed Quantum State ManagementACM Transactions on Modeling and Computer Simulation10.1145/363470134:2(1-28)Online publication date: 31-Jan-2024
  • (2022)Advanced TutorialProceedings of the Winter Simulation Conference10.5555/3586210.3586232(268-282)Online publication date: 11-Dec-2022
  • (2022)A Scalable Quantum Key Distribution Network Testbed Using Parallel Discrete-Event SimulationACM Transactions on Modeling and Computer Simulation10.1145/349002932:2(1-22)Online publication date: 4-Mar-2022
  • (2022)Advanced Tutorial: Parallel and Distributed Methods for Scalable Discrete Simulation2022 Winter Simulation Conference (WSC)10.1109/WSC57314.2022.10015291(268-282)Online publication date: 11-Dec-2022
  • (2019)Machine learning applied to accelerate energy consumption models in computing simulatorsSimulation Modelling Practice and Theory10.1016/j.simpat.2019.102012(102012)Online publication date: Oct-2019
  • (2018)Guest Editorial for the TOMACS Special Issue on the Principles of Advanced Discrete Simulation (PADS)ACM Transactions on Modeling and Computer Simulation10.1145/326745928:4(1-2)Online publication date: 3-Oct-2018

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media