ABSTRACT
In computer simulations many processes are highly repetitive. These repetitions are amplified further when a parameter study is conducted where the same model is repeatedly executed with varying parameters, especially when performing multiple runs to increase statistical confidence. Inevitably, such repetitions result in the execution of identical computations, with identical code, identical input, and hence identical output. Performing computations redundantly wastes resources and the execution time of a parameter study could be reduced if the redundancies were avoided.
To this end, the idea of memoization was proposed decades ago. However, until today memoization is either performed manually or automated memoization approaches are used that can only handle pure functions. This means that only the function parameters and the return value may be input and output of the function whereas side effects are not allowed. In order to expand the scope of automated memoization to a larger class of programs, we propose an approach able to reliably detect the full input and output of a function, including reading and writing objects through arbitrarily indirect pointers with some preconditions. We show the feasibility of our approach and derive simple performance approximations enabling rough predictions of the expected benefit. By means of a simple case study performing an OFDM network simulation, we demonstrate the practical suitability of our approach, speeding up the execution of the whole parameter study by a factor of 75, while only doubling memory consumption.
- E. W. Dijkstra. Go To Statement Considered Harmful. Communications of the ACM, 11(3):147--148, 1968. Google ScholarDigital Library
- S. Ferenci, R. Fujimoto, M. Ammar, K. Perumalla, and G. Riley. Updateable Simulation of Communication Networks. In Proc. of the 16th Workshop on Parallel and Distributed Simul., pages 107--114, 2002. Google ScholarDigital Library
- H. T. Friis. A Note on a Simple Transmission Formula. Proc. of the Institute of Radio Engineers, 34(5):254--256, 1946.Google Scholar
- M. Hall and J. Mayfield. Improving the Performance of AI Software: Payoffs and Pitfalls in Using Automatic Memoization. In Proc. of the 6th Intl. Symposium on Artificial Intelligence, 1993.Google Scholar
- T. R. Henderson, S. Roy, S. Floyd, and G. F. Riley. ns-3 Project Goals. In Proc. of the 1st Workshop on ns-2: the IP network simulator, 2006. Google ScholarDigital Library
- R. Hinze. Memo Functions, Polytypically! In Proc. of the 2nd Workshop on Generic Programming, pages 17--32, 2000.Google Scholar
- M. Hybinette and R. Fujimoto. Cloning: A Novel Method for Interactive Parallel Simulation. In Proc. of the 29th Winter Simul. Conf., pages 444--451, 1997. Google ScholarDigital Library
- M. Hybinette and R. M. Fujimoto. Cloning Parallel Simulations. ACM Transaction on Modeling and Computer Simul., 11(4):378--407, 2001. Google ScholarDigital Library
- ISO. ISO/IEC 14882:2014 Information technology -- Programming languages -- C++. International Organization for Standardization, Geneva, Switzerland, Dec. 2014.Google Scholar
- K. Kamimura, R. Oda, T. Yamada, T. Tsumura, H. Matsuo, and Y. Nakashima. A Speed-up Technique for an Auto-Memoization Processor by Reusing Partial Results of Instruction Regions. In Proc. of the 3rd Intl. Conf. on Networking and Computing, pages 49--57, 2012. Google ScholarDigital Library
- D. E. Knuth. Structured Programming with go to Statements. ACM Comp. Surveys, 6(4):261--301, 1974. Google ScholarDigital Library
- W. Landi. Undecidability of Static Analysis. ACM Letters on Programming Languages and Systems, 1(4):323--337, 1992. Google ScholarDigital Library
- J. Mayfield, T. Finin, and M. Hall. Using Automatic Memoization as a Software Engineering Tool in Real-World AI Systems. In Proc. of the 11th Conf. on Artificial Intelligence for Applications, pages 87--93, 1995. Google ScholarDigital Library
- P. McNamee and M. Hall. Developing a Tool for Memoizing Functions in C++. ACM SIGPLAN Notices, 33(8):17--22, 1998. Google ScholarDigital Library
- D. Michie. Memo functions: a language feature with "rote-learning" properties. Technical report, Edinburgh University, Dept. of Machine Intelligence and Perception, 1967.Google Scholar
- D. Michie. Memo Functions and Machine Learning. Nature, 218(5136):19--22, 1968.Google ScholarCross Ref
- J. Mostow and D. Cohen. Automating Program Speedup by Deciding What to Cache. In Proc. of the 9th Intl. Joint Conf. on Artificial Intelligence, pages 165--172, 1985. Google ScholarDigital Library
- P. Norvig. Techniques for Automatic Memoization with Applications to Context-Free Parsing. Computational Linguistics, 17(1):91--98, 1991. Google ScholarDigital Library
- R. Popplestone. Memo functions and the POP-2 language. Technical report, Edinburgh University, Dept. of Machine Intelligence and Perception, 1967.Google Scholar
- D. Tsafrir, R. Wisniewski, D. Bacon, and B. Stroustrup. Minimizing Dependencies within Generic Classes for Faster and Smaller Programs. ACM SIGPLAN Notices, 44(10):425--444, 2009. Google ScholarDigital Library
- T. Tsumura, I. Suzuki, Y. Ikeuchi, H. Matsuo, H. Nakashima, and Y. Nakashima. Design and Evaluation of an Auto-Memoization Processor. In Proc. of the 25th Intl. Multi-Conf. on Parallel and Distributed Computing and Networks, pages 230--235, 2007. Google ScholarDigital Library
- A. Varga. The OMNeT++ Discrete Event Simulation System. In Proc. of the 15th European Simul. Multiconference, 2001.Google Scholar
- C. Wang, M. Pätzold, and Q. Yao. Stochastic Modeling and Simulation of Frequency-Correlated Wideband Fading Channels. IEEE Transaction on Vehicular Technology, 56(3):1050--1063, 2007.Google ScholarCross Ref
- N.-F. Zhou and T. Sato. Efficient Fixpoint Computation in Linear Tabling. In Proc. of the 5th ACM SIGPLAN Intl. Conf. on Principles and Practice of Declarative Programming, pages 275--283, 2003. Google ScholarDigital Library
Index Terms
- Automated Memoization for Parameter Studies Implemented in Impure Languages
Recommendations
On Automated Memoization in the Field of Simulation Parameter Studies
Special Issue on PADS 2016Processes 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 ...
Automated memoization: automatically identifying memoization units in simulation parameter studies
DS-RT '17: Proceedings of the 21st International Symposium on Distributed Simulation and Real Time ApplicationsSimulations, and in particular large scale parameter studies, typically exhibit a considerable amount of redundancies. These redundancies can be avoided by memoization, a technique that stores and re-uses intermediate results. This requires a ...
Using automatic memoization as a software engineering tool in real-world AI systems
CAIA '95: Proceedings of the 11th Conference on Artificial Intelligence for ApplicationsMemo functions and memoization are well-known concepts in AI programming. They have been discussed since the sixties and are often used as examples in introductory programming texts. However, the automation of memoization as a practical software ...
Comments