Skip to main content

Acceleration of Classical Molecular Dynamics Simulations

  • Chapter
  • First Online:
The Art of High Performance Computing for Computational Science, Vol. 2

Abstract

In this chapter, we describe the acceleration and parallelization in classical molecular dynamics simulations. As electrostatic interactions are computationally intensive, the importance of the particle mesh Ewald (PME) method and the fast multipole method (FMM) will increase. These methods will be described here. In addition, general techniques for hierarchical parallelization on the latest general-purpose supercomputers (especially connected by a three-dimensional torus network), together with the critical importance of the data array structure, are explained. We show the optimization and benchmark results in the parallel environments of the molecular dynamics calculation programs, MODYLAS and GENESIS.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. W.D. Cornell, P. Cieplak, C.I. Bayly, I.R. Gould, K.M. Merz Jr., D.M. Ferguson, D.C. Spellmeyer, T. Fox, J.W. Caldwell, P.A. Kollman, J. Am. Chem. Soc. 117, 51795197 (1995)

    Google Scholar 

  2. A.D. MacKerell Jr., M. Feig, C.L. Brooks III, J. Comput. Chem. 25, 14001415 (2004)

    Google Scholar 

  3. W.L. Jorgensen, D.S. Maxwell, J. Tirado-Rives, J. Am. Chem. Soc. 118, 1122511236 (1996)

    Google Scholar 

  4. H.J.C. Berendsen, D. van der Spoel, R. van Drunen, Comput. Phys. Commun. 91, 43–56 (1995)

    Google Scholar 

  5. J.C. Phillips, R. Braun, W. Wang, J. Gumbart, E. Tajkhorshid, E. Villa, C. Chipot, R.D. Skeel, L. Kale, K. Schulten, J. Comput. Chem. 26, 1781–1802 (2005)

    Google Scholar 

  6. S. Plimpton, J. Comput. Phys. 117, 1–19 (1995)

    Article  Google Scholar 

  7. Y. Andoh et al., J. Chem. Theory Comput. 9, 3201 (2013)

    Article  Google Scholar 

  8. J. Jung, T. Mori, C. Kobayashi, Y. Matsunaga, T. Yoda, M. Feig, Y. Sugita, WIREs Comput. Mol. Sci. 5, 310 (2015)

    Google Scholar 

  9. D. Frenkel, B. Smit, Understanding Molecular Simulation (Academic Press, San Diego, 1996)

    Google Scholar 

  10. M.E. Tuckerman, Statistical Mechanics: Theory and Molecular Simulation (Oxford University Press, New York, 2010)

    MATH  Google Scholar 

  11. M.P. Allen, D.J. Tildesley, Computer Simulation of Liquids (Oxford University Press, 1989)

    Google Scholar 

  12. J. Wong-ekkabut, M. Karttunen, Biochim. Biophys. Acta 1858, 2529 (2016)

    Article  Google Scholar 

  13. T. Darden, D. York, L. Pedersen, J. Chem. Phys. 98, 10089 (1993)

    Article  Google Scholar 

  14. U. Essmann, L. Perera, M.L. Berkowitz, T. Darden, H. Lee, L.G. Pedersen, J. Chem. Phys. 103, 8577 (1995)

    Article  Google Scholar 

  15. L. Greengard, V. Rokhlin, J. Comput. Phys. 73, 325 (1987)

    Article  MathSciNet  Google Scholar 

  16. D.J. Hardy, Z. Wu, J.C. Phillips, J.E. Stone, R.D. Skeel, K. Schulten, J. Chem. Theory Comput. 11, 766 (2015)

    Article  Google Scholar 

  17. J.J. Biesiadecki, R.D. Skeel, J. Comput. Phys. 109, 318–328 (1993)

    Article  MathSciNet  Google Scholar 

  18. P. Minary, M.E. Tuckerman, G.J. Martyna, Phys. Rev. Lett. 93, 150201 (2004)

    Article  Google Scholar 

  19. J.P. Ryckaert, G. Ciccotti, H.J.C. Berendsen, J. Comput. Phys. 23, 327341 (1977)

    Article  Google Scholar 

  20. P. Gonnet, J. Comput. Phys. 220, 740 (2007)

    Article  MathSciNet  Google Scholar 

  21. H.C. Andersen, J. Comput. Phys. 52, 2434 (1983)

    Article  Google Scholar 

  22. B. Hess, H. Bekker, H.J.C. Berendsen, J.G.E.M. Fraaije, J. Comput. Chem. 18, 14631472 (1997)

    Article  Google Scholar 

  23. S. Miyamoto, P.A. Kollman, J. Comput. Chem. 13, 952962 (1992)

    Article  Google Scholar 

  24. H. Okumura, S.G. Itoh, Y. Okamoto, J. Chem. Phys. 126, 084103 (2007)

    Article  Google Scholar 

  25. K.J. Bowers et al., in ACM/IEEE Conference on Supercomputing (SC06) (IEEE, Tampa, Florida, 2006)

    Google Scholar 

  26. K.J. Bowers, R.O. Dror, D.E. Shaw, J. Chem. Phys. 124, 184109 (2006)

    Article  Google Scholar 

  27. B.G. Fitch, A. Rayshubskiy, M. Eleftheriou, T.J.C. Ward, M. Giampapa, M.C. Pitman, J. Pitera, W.C. Swope, R.S. Germain, Comput. Model. Membr. Bilayers 60, 159 (2008)

    Article  Google Scholar 

  28. J. Jung, C. Kobayashi, T. Imamura, Y. Sugita, Comput. Phys. Commun. 200, 57 (2016)

    Article  MathSciNet  Google Scholar 

  29. A.P. Hynninen, M.F. Crowley, J. Comput. Chem. 35, 406 (2014)

    Article  Google Scholar 

  30. B. Hess, C. Kutzner, D. van der Spoel, E. Lindahl, J. Chem. Theory Comput. 4, 435 (2008)

    Article  Google Scholar 

  31. T. Narumi et al., in Proceedings of the 2006 ACM/IEEE Conference on Supercomputing (ACM, 2006), p. 49

    Google Scholar 

  32. D.E. Shaw et al., in 34th Annual International Symposium on Computer Architecture (ISCA ’07) (ACM, 2007), p. 910

    Google Scholar 

  33. D.E. Shaw et al., in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (IEEE Press, 2014), p. 41

    Google Scholar 

  34. R. Salomon-Ferrer, A.W. Gotz, D. Poole, S. Le Grand, R.C. Walker, J. Chem. Theory Comput. 9, 3878 (2013)

    Article  Google Scholar 

  35. M.J. Harvey, G. Giupponi, G. De Fabritiis, J. Chem. Theory Comput. 5, 1632 (2009)

    Article  Google Scholar 

  36. P. Eastman et al., J. Chem. Theory Comput. 9, 461 (2013)

    Article  Google Scholar 

  37. A.P. Ruymgaart, A.E. Cardenas, R. Elber, J. Chem. Theory Comput. 7, 3072 (2011)

    Article  Google Scholar 

  38. J.C. Phillips, Y. Sun, N. Jain, E.J. Bohm, L.V. Kal, in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (IEEE Press, 2014), p. 81

    Google Scholar 

  39. M.J. Abraham, T. Murtola, R. Schulz, S. Pali, J.C. Smith, B. Hess, E. Lindahl, Softw. X 1–2, 19 (2015)

    Google Scholar 

  40. Jung et al., J. Chem. Theory Comput. 12, 4947 (2016)

    Google Scholar 

  41. W.J. Harrod, A journey to exascale computing, in The International Conference for High Performance Computing, Networking, Storage and Analysis, SC12 (2012), https://science.energy.gov/~/media/ascr/ascac/pdf/reports/2013/SC12_Harrod.pdf

  42. https://software.intel.com/en-us/articles/explicit-vector-programming-in-fortran

  43. https://software.intel.com/sites/landingpage/IntrinsicsGuide/

  44. Y. Andoh, S. Suzuki, S. Ohshima, T. Sakashita, M. Ogino, T. Katagiri, N. Yoshii, S. Okazaki, J. Supercomput. 74, 2449 (2018)

    Article  Google Scholar 

  45. J. Jung, T. Mori, Y. Sugita, J. Comput. Chem. 34, 2412 (2013)

    Article  Google Scholar 

  46. T. Amisaki, J. Comput. Chem. 21, 10751087 (2000)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to N. Yoshii .

Editor information

Editors and Affiliations

Appendix: FMM

Appendix: FMM

The principle of the fast multipole method (FMM) is briefly explained in this Appendix. See Ref. [15] for exact mathematical treatment of the transformation of multipole moment and local expansion coefficients, such as M2M, M2L, and L2L.

5.1.1 Fundamentals of Multipole Expansion

As shown in Fig. 5.15, the atom i of the charge \(q_i\) in a certain area forms the potential at a distant point Q. The reciprocal \(1/r_i\) of the distance between two points is calculated using the distance \(\Delta { r_i}\) from the origin O to the atom i in the region, the distance r from the origin O to the point Q, and the angle \(\gamma _i\) formed by the points \(\Delta {r_i}\) and r with the point O. This can be expressed as

$$\begin{aligned} \frac{1}{r_i} = \frac{1}{\sqrt{r^2 - 2r\Delta r_i \cos \gamma _i + \Delta r_i^2}} = \frac{1}{r \sqrt{1 - 2 \frac{\Delta r_i}{r} \cos \gamma _i + \left( \frac{\Delta r_i}{r} \right) ^2 }} \end{aligned}$$
(5.14)

from the cosine theorem. When this equation is rewritten by Taylor expansion, it becomes

$$\begin{aligned} \frac{1}{r_i}= & {} \frac{1}{r} + \frac{\Delta r_i}{r^2} \cos \gamma _i + \frac{\Delta r_i^2}{2 r^3} \left( 3 \cos ^2 \gamma _i - 1 \right) + \frac{\Delta r_i^3}{2 r^4} \left( 5 \cos ^3 \gamma _i - 3 \cos \gamma _i \right) + \cdots \nonumber \\= & {} \frac{1}{r} \sum _n P_n(\cos \gamma _i) \left( \frac{\Delta r_i}{r} \right) ^n, \end{aligned}$$
(5.15)

where \(P_n(\cos \gamma _i)\) is a Legendre polynomial. This Eq. (5.15) is called multipole expansion. \(P_n(\cos \gamma _i)\) is written as

$$\begin{aligned} P_n(\cos \gamma _i) = \sum _{m=-m}^{n} Y_n^{-m} (\theta _i, \phi _i) Y_n^m (\theta ,\phi ) \end{aligned}$$
(5.16)

using the spherical harmonics, \(Y_n^m(\theta ,\phi )\) for spherical coordinates \((\Delta r_i, \theta _i,\phi _i)\) and \((r, \theta , \phi )\) of the two vectors \(\Delta r_i\) and r. In Eq. (5.16), the coordinate variables of atom i and point Q are completely separated into two factors. Therefore, the sum with respect to the charges in a region can be represented independently of the position of the point Q. The sum

$$\begin{aligned} M_n^m = \sum _i q_i Y_n^{-m}(\theta _i,\phi _i) {\Delta r_i}^n \end{aligned}$$
(5.17)

is the multipole moment formed by the charge in the region. The electrostatic field formed by all charges in the region can be expressed as

$$\begin{aligned} \sum _i \frac{q_i}{r_i} = \frac{1}{r^{n+1}} \sum _{n=0} \sum _{m=-n}^{n} M_n^m Y_n^{m} (\theta ,\phi ). \end{aligned}$$
(5.18)
Fig. 5.15
figure 15

Multipole expansion of electrostatic interaction

5.1.2 Division of Unit Cells

In FMM, unit cells are divided into small spaces (subcells). As described in the next section, the interaction calculation is performed using these subcells. There are several ways to divide unit cells into subcells; however, an octree structure is commonly used, in which each side of the unit cell is divided into two equal parts and the whole is divided into eight subcells (Fig. 5.16). This division is repeated until the subcell reaches the desired size of small subcells, i.e., level 0 for the unit cell and level 1 after dividing once. The number of subcells of level n is \(8^n\). In practical use, tens of atoms are assigned to the smallest subcell. This smallest subcell is a unit of regional division. We assign subcells to compute nodes and cores to perform parallel calculations.

Fig. 5.16
figure 16

Division of unit cell

5.1.3 Interaction Calculation by FMM

We assume that the unit cell is divided to level 4, as shown in Fig. 5.17. We now calculate the potential of an atom in region A. First, we evaluate the electrostatic interaction directly up to the second nearest neighbor (B) of region A of level 4. For subcells beyond region B, the interaction calculation is performed using multipole moments.

Fig. 5.17
figure 17

Interactions between atoms and subcell

Region C is within the second nearest neighbor of the subcell of level 3, but excluding region B. The interaction calculation with region C is performed using the multipole moment of level 4. Region D is within the second nearest neighbor of the subcell of level 2, but excluding region C. The interaction calculation with region B is performed using the multipole moment of level 3. Hereinafter, regions E and F are determined in the same manner. Subcells beyond region F (image cell of third or further nearest neighbor of the unit cell) are treated as those of level 0. Thus, the interactions can be calculated for each region without excess or deficiency. By using small subcells for interactions with neighboring regions and large subcells for interactions with distant regions, it is possible to efficiently perform interaction calculations without decreasing accuracy.

5.1.4 Multipole Expansion and Local Expansion

The procedure for determining the potential acting on the i atom in region A is shown (Fig. 5.18). First, the contributions from regions A and B is obtained by direct calculation. This procedure is called particle to particle (P2P) in FMM. For region C, the multipole moment is calculated in level 4 subcells according to Eq. (5.17). This operation is called particle to multipole (P2M). Next, the center of the multipole moment is moved to the center of subcell A. The expression obtained by this transformation is the form of Taylor expansion at the center of subcell A, which is called local expansion. This shift operation of the expansion center is called multipole to local (M2L) . By using the local expansion coefficient and the relative position from the center subcell of atom i, its potential, force, and virial can be calculated, which is called local to particle (L2P). For the further subcell D, the multipole moment of the level 4 subcell is obtained by P2M similarly to C. The expansion center of the multipole moment is shifted to the center position of the level 3 subcell (i.e., multipole to multipole (M2M)). Similarly, with respect to the other seven subcells, the center of expansion is shifted by M2M. The obtained multipole moments are summed to obtain a multipole moment of level 3, which is transformed to the local expansion coefficient of the level 3 subcell, including subcell A, by M2L operation. The local expansion coefficient is shifted to the center of the subcell of level A (i.e., local to local (L2L)). The contributions from the previously obtained subcell C and the subcells D are summed and then the interaction is evaluated by L2P. The contribution from image cells more distant than region F in Fig. 5.17 can be included by applying Ewald’s method to the multipole moment of image cells [46].

Fig. 5.18
figure 18

Interaction between atoms and subcell

5.1.5 Accuracy of FMM

FMM is a strictly formulated analytical method that includes error evaluation. The error depends on the expansion order of the multipole moment; i.e., as the order increases, the calculation accuracy monotonically increases. Table 5.1 shows the benchmark results of potential and force in a system consisting of 10,125,000 atoms using MODYLAS software. The accuracy of FMM was evaluated by comparison with the result of the PME method with parameters giving a sufficiently high accuracy. The values obtained at the 4th to 8th expansion order coincide with the exact value in the range of 4–9 digits. There is also an accuracy of 4–7 digits for force; i.e., enough accuracy can be obtained for MD calculations  even in expansions up to the 4thorder.

Table 5.1 Potential and force obtained by FMM

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Singapore Pte Ltd.

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Andoh, Y., Yoshii, N., Jung, J., Sugita, Y. (2019). Acceleration of Classical Molecular Dynamics Simulations. In: Geshi, M. (eds) The Art of High Performance Computing for Computational Science, Vol. 2. Springer, Singapore. https://doi.org/10.1007/978-981-13-9802-5_5

Download citation

  • DOI: https://doi.org/10.1007/978-981-13-9802-5_5

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-13-9801-8

  • Online ISBN: 978-981-13-9802-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics