Skip to main content
Log in

Modular implementation of dynamic algorithm switching in parallel simulations

  • Published:
Cluster Computing Aims and scope Submit manuscript

Abstract

We present a modular approach to implementing dynamic algorithm switching for parallel scientific software. By using a compositional framework based on function call interception techniques, our proposed method transparently integrates algorithm switching code with a given program without directly modifying the original code structure. Through fine-grained control of algorithmic behavior of an application at the level of functions, our approach supports design and implementation of application-specific switching scenarios in a modular way. Our approach encourages algorithm switching to dynamically perform at the loop end of a parallel simulation, where cooperating processes in concurrent execution typically synchronize and intermediate computation results are consistent. In this way, newly added switching operations do not cause race conditions that may produce unreliable computation results in parallel simulations. By applying our method to a real-world scientific application and adapting its algorithmic behavior to the properties of input problems, we demonstrate the applicability and effectiveness of our approach to constructing efficient parallel simulations.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

References

  1. AspeCt-oriented C Compiler. http://www.aspectc.net

  2. An, P., Jula, A., Rus, S., Saunders, S., Smith, T., Tanase, G., Thomas, N., Amato, N.M., Rauchwerger, L.: STAPL: an adaptive, generic parallel C++ library. In: Dietz, H.G. (ed.) LCPC, Lecture Notes in Computer Science, vol. 2624, pp. 193–208. Springer, Berlin (2001)

    Google Scholar 

  3. Barrett, R., Berry, M., Dongarra, J., Eijkhout, V., Romine, C.: Algorithmic bombardment for the iterative solution of linear systems: a poly-iterative approach. J. Comput. Appl. Math. 74(1–2), 91–109 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  4. Bhowmick, S., McInnes, L., Norris, B., Raghavan, P.: Robust algorithms and software for parallel PDE-based simulations. In: Proceedings of the Advanced Simulation Technologies Conference, ASTC’04, April 18–22 (2004). Society for Modeling and Simulation International (SCS)

    Google Scholar 

  5. Bhowmick, S., McInnes, L.C., Norris, B., Raghavan, P.: The role of multi-method linear solvers in PDE-based simulations. In: Kumar, V., Gavrilova, M.L., Tan, C.J.K., L’Ecuyer, P. (eds.) Computational Science and Its Applications—ICCSA 2003, Part I, vol. 2667, pp. 828–839. Springer, Berlin (2003)

    Chapter  Google Scholar 

  6. Buck, B., Hollingsworth, J.K.: An API for runtime code patching. Int. J. High Perform. Comput. Appl. 14(4), 317–329 (2000)

    Article  Google Scholar 

  7. Cao, Y., Gillespie, D.T., Petzold, L.R.: Accelerated stochastic simulation of the stiff enzyme-substrate reaction. J. Chem. Phys. 123(14), 144,917.1–144,917.12 (2005)

    Article  Google Scholar 

  8. Cao, Y., Gillespie, D.T., Petzold, L.R.: The slow-scale stochastic simulation algorithm. J. Chem. Phys. 122(1), 014,116 (2005)

    Article  Google Scholar 

  9. Cao, Y., Petzold, L.R.: Trapezoidal tau-leaping formula for the stochastic simulation of biochemical systems. In: Proceedings of Foundations of Systems Biology in Engineering (FOSBE), pp. 149–152 (2005)

    Google Scholar 

  10. Du, W., Agrawal, G.: Language and compiler support for adaptive applications. In: SC’04: Proceedings of the 2004 ACM/IEEE Conference on Supercomputing, p. 29. IEEE Computer Society, Washington (2004)

    Google Scholar 

  11. Ensink, B., Stanley, J., Adve, V.: Program control language: a programming language for adaptive distributed applications. J. Parallel Distrib. Comput. 63(11), 1082–1104 (2003)

    Article  MATH  Google Scholar 

  12. Ern, A., Giovangigli, V., Keyes, D.E., Smooke, M.D.: Towards polyalgorithmic linear system solvers for nonlinear elliptic problems. SIAM J. Sci. Comput. 15(3), 681–703 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  13. Gillespie, D.T.: A general method for numerically simulating the stochastic time evolution of coupled chemical reactions. J. Comput. Phys. 22(4), 403–434 (1976)

    Article  MathSciNet  Google Scholar 

  14. Gillespie, D.T.: Exact stochastic simulation of coupled chemical reactions. J. Phys. Chem. 81(25), 2340–2361 (1977)

    Article  Google Scholar 

  15. Gillespie, D.T.: Approximate accelerated stochastic simulation of chemically reacting systems. J. Chem. Phys. 115(4), 1716–1733 (2001)

    Article  Google Scholar 

  16. Gropp, W., Lusk, E., Skjellum, A.: Using MPI: Portable Parallel Programming with the Message-Passing Interface. MIT Press, Cambridge (1999)

    Google Scholar 

  17. Hilsdale, E., Hugunin, J.: Advice weaving in AspectJ. In: AOSD’04: Proceedings of the 3rd International Conference on Aspect-Oriented Software Development, pp. 26–35. ACM, New York (2004)

    Chapter  Google Scholar 

  18. Johnson, T.A., Eigenmann, R.: Context-sensitive domain-independent algorithm composition and selection. ACM SIGPLAN Not. 41(6), 181–192 (2006)

    Article  Google Scholar 

  19. Kang, P., Cao, Y., Ramakrishnan, N., Ribbens, C.J., Varadarajan, S.: Modular implementation of adaptive decisions in stochastic simulations. In: SAC’09: Proceedings of the 24th Annual ACM Symposium on Applied Computing, pp. 995–1001. ACM, New York (2009)

    Google Scholar 

  20. Kang, P., Heffner, M.A., Ramakrishnan, N., Ribbens, C.J., Varadarajan, S.: Adaptive code collage: a framework to transparently modify scientific codes. IEEE Comput. Sci. Eng. 14(1), 52–63 (2012)

    Google Scholar 

  21. Kang, P., Selvarasu, N.K.C., Ramakrishnan, N., Ribbens, C.J., Tafti, D.K., Varadarajan, S.: Modular, fine-grained adaptation of parallel programs. In: ICCS’09: Proceedings of the 9th International Conference on Computational Science, pp. 269–279. Springer, Berlin (2009)

    Google Scholar 

  22. Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: ECOOP’01: Proceedings of the 15th European Conference on Object-Oriented Programming, pp. 327–353. Springer, London (2001)

    Google Scholar 

  23. Kiczales, G., Lamping, J., Menhdhekar, A., Maeda, C., Lopes, C., Loingtier, J.M., Irwin, J.: Aspect-oriented programming. In: Proceedings of the European Conference on Object-Oriented Programming, vol. 1241, pp. 220–242. Springer, Berlin (1997)

    Google Scholar 

  24. Li, H., Cao, Y., Petzold, L.R., Gillespie, D.T.: Algorithms and Software for Stochastic Simulation of Biochemical Reacting Systems (2008)

    Google Scholar 

  25. Lindholm, T., Yellin, F.: The Java virtual machine specification. http://java.sun.com/docs/books/vmspec/

  26. Luk, C.K., Cohn, R., Muth, R., Patil, H., Klauser, A., Lowney, G., Wallace, S., Reddi, V.J., Hazelwood, K.: Pin: building customized program analysis tools with dynamic instrumentation. In: PLDI’05: Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 190–200. ACM, New York (2005)

    Chapter  Google Scholar 

  27. Rathinam, M., Petzold, L.R., Cao, Y., Gillespie, D.T.: Stiffness in stochastic chemically reacting systems: the implicit tau-leaping method. J. Chem. Phys. 119(24), 12,784–12,794 (2003)

    Article  Google Scholar 

  28. Spinczyk, O., Gal, A., Schröder-Preikschat, W.: AspectC++: an aspect-oriented extension to the C++ programming language. In: CRPIT’02: Proceedings of the 40th International Conference on Tools Pacific, pp. 53–60. Australian Computer Society, Inc., Darlinghurst (2002)

    Google Scholar 

  29. Srivastava, A., Eustace, A.: ATOM: a system for building customized program analysis tools. In: PLDI’94: Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, pp. 196–205. ACM, New York (1994)

    Chapter  Google Scholar 

  30. Thomas, N., Tanase, G., Tkachyshyn, O., Perdue, J., Amato, N.M., Rauchwerger, L.: A framework for adaptive algorithm selection in STAPL. In: PPoPP’05: Proceedings of the Tenth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp. 277–288. ACM, New York (2005)

    Chapter  Google Scholar 

  31. Voss, M.J., Eigemann, R.: High-level adaptive program optimization with ADAPT. In: PPoPP’01: Proceedings of the 8th ACM SIGPLAN Symposium on Principles and Practices of Parallel Programming, pp. 93–102. ACM, New York (2001)

    Chapter  Google Scholar 

  32. Yu, H., Zhang, D., Rauchwerger, L.: An adaptive algorithm selection framework. In: PACT’04: Proceedings of the 13th International Conference on Parallel Architectures and Compilation Techniques, pp. 278–289. IEEE Computer Society, Washington (2004)

    Chapter  Google Scholar 

Download references

Acknowledgements

The authors would like to thank the department of computer science of Virginia Tech for letting us use the Anantham cluster for this research.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Pilsung Kang.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Kang, P. Modular implementation of dynamic algorithm switching in parallel simulations. Cluster Comput 15, 321–332 (2012). https://doi.org/10.1007/s10586-012-0205-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10586-012-0205-z

Keywords

Navigation