skip to main content
10.1145/2901378.2901386acmconferencesArticle/Chapter ViewAbstractPublication PagespadsConference Proceedingsconference-collections
research-article

Automated Memoization for Parameter Studies Implemented in Impure Languages

Published:15 May 2016Publication History

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.

References

  1. E. W. Dijkstra. Go To Statement Considered Harmful. Communications of the ACM, 11(3):147--148, 1968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. H. T. Friis. A Note on a Simple Transmission Formula. Proc. of the Institute of Radio Engineers, 34(5):254--256, 1946.Google ScholarGoogle Scholar
  4. 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 ScholarGoogle Scholar
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. R. Hinze. Memo Functions, Polytypically! In Proc. of the 2nd Workshop on Generic Programming, pages 17--32, 2000.Google ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Hybinette and R. M. Fujimoto. Cloning Parallel Simulations. ACM Transaction on Modeling and Computer Simul., 11(4):378--407, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. ISO. ISO/IEC 14882:2014 Information technology -- Programming languages -- C++. International Organization for Standardization, Geneva, Switzerland, Dec. 2014.Google ScholarGoogle Scholar
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. E. Knuth. Structured Programming with go to Statements. ACM Comp. Surveys, 6(4):261--301, 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. W. Landi. Undecidability of Static Analysis. ACM Letters on Programming Languages and Systems, 1(4):323--337, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. McNamee and M. Hall. Developing a Tool for Memoizing Functions in C++. ACM SIGPLAN Notices, 33(8):17--22, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Michie. Memo functions: a language feature with "rote-learning" properties. Technical report, Edinburgh University, Dept. of Machine Intelligence and Perception, 1967.Google ScholarGoogle Scholar
  16. D. Michie. Memo Functions and Machine Learning. Nature, 218(5136):19--22, 1968.Google ScholarGoogle ScholarCross RefCross Ref
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. Norvig. Techniques for Automatic Memoization with Applications to Context-Free Parsing. Computational Linguistics, 17(1):91--98, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. R. Popplestone. Memo functions and the POP-2 language. Technical report, Edinburgh University, Dept. of Machine Intelligence and Perception, 1967.Google ScholarGoogle Scholar
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. Varga. The OMNeT++ Discrete Event Simulation System. In Proc. of the 15th European Simul. Multiconference, 2001.Google ScholarGoogle Scholar
  23. 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 ScholarGoogle ScholarCross RefCross Ref
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automated Memoization for Parameter Studies Implemented in Impure Languages

      Recommendations

      Reviews

      William M. Waite

      Memoization is a technique for avoiding reevaluation of a function when the result of a new evaluation will be the same as the result of the previous evaluation. In that case, the previous result is returned instead of executing the function. The technique is only useful when function evaluation is more expensive than the total cost of remembering the old result and checking that the new result would actually equal the old one. Stoffers et al. are running computer simulations in which particular models are simulated repeatedly, a poster case for memoization. Their problem is dealing with code written in C++, a language in which it may be quite difficult to determine the set of values influencing a result. The paper does a good job of explaining the issues and how they are addressed in the authors' system. Performance data is presented for both a synthetic benchmark and a live simulation. This is an interesting paper, one that clearly explains the memoization concept and extends its applicability to functions with side effects and complex interactions. There is a good discussion of related work and a comprehensive set of references. The paper is clearly written and accessible to anyone who has a reasonable understanding of C++. Online Computing Reviews Service

      Access critical reviews of Computing literature here

      Become a reviewer for Computing Reviews.

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        SIGSIM-PADS '16: Proceedings of the 2016 ACM SIGSIM Conference on Principles of Advanced Discrete Simulation
        May 2016
        272 pages
        ISBN:9781450337427
        DOI:10.1145/2901378

        Copyright © 2016 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: 15 May 2016

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate398of779submissions,51%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader