Skip to main content

Increasing Parallelism and Reducing Thread Contentions in Mapping Localized N-Body Simulations to GPUs

  • Chapter
  • First Online:
Numerical Computations with GPUs

Abstract

The use of graphics processors to accelerate N-body simulations has been widely studied. The primary focus of most of these studies has been a class of problems that model the entire system of bodies interacting under Newtonian dynamic laws. A separate class of N-body problems, referred to herein as localized N-body simulations, focus on simulating only a small region of the system, with random state updates in order to find a local optimum. Due to the differences in the problem geometries, the widely applied algorithms and data structures for accelerating N-body simulations are less effective when applied to localized N-body problems. In this chapter, we present techniques for effective parallelization and acceleration of such localized N-body simulations on GPUs. Using energy minimization simulations as a case study, we show the challenges in using the existing data structures in accelerating localized N-body simulations and propose modified data structures and algorithms that enable better parallelism, achieving 7× to 27× speedup over serial code.

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 119.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 159.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. Stone, J.E., Hardy, D.J., Ufimtsev, I.S., Schulten, K.: GPU-accelerated molecular modeling coming of age. J. Mol. Graph. Model. 29(2), 116–125 (2010)

    Article  Google Scholar 

  2. OpenMM: GPU-accelerated toolkit for molecular simulations. https://simtk.org/home/openmm/

  3. Brooks, B.R., et al.: CHARMM: a program for macromolecular energy, minimization, and dynamics calculations. J. Comput. Chem. 4, 187–217 (1983)

    Article  Google Scholar 

  4. http://cmm.cit.nih.gov/intro_simulation/node22.html

  5. Pappu, R.V., Hart, R.K., Ponder, J.W.: Analysis and application of potential energy smoothing and search methods for global optimization. J. Phys. Chem. B 102, 9725–9742 (1998)

    Article  Google Scholar 

  6. Sukhwani, B., Herbordt, M.C.: Fast binding site mapping using GPUs and CUDA. In: Proceedings of the Ninth International Workshop on High Performance Computational Biology (HiCOMB’10) (2010)

    Google Scholar 

  7. Sukhwani, B., Herbordt, M.C.: FPGA-based acceleration of CHARMM-potential minimization. In: Proceedings of the Third International Workshop on High-Performance Reconfigurable Computing Technology and Applications (HPRCTA’09) (2009)

    Google Scholar 

  8. Sukhwani, B., Herbordt, M.C.: Accelerating energy minimization using graphics processors. In: Proceedings of the 2009 Symposium on Application Accelerators in High Performance Computing (SAAHPC’09) (2009)

    Google Scholar 

  9. Schaefer, M., Karplus, M.: A comprehensive analytical treatment of continuum electrostatics. J. Phys. Chem. 100(5), 1578–1599 (1996)

    Article  Google Scholar 

  10. Still, W.C., et al.: Semianalytical treatment of solvation for molecular mechanics and dynamics. J. Am. Chem. Soc. 112(16), 6127–6129 (1990)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bharat Sukhwani .

Editor information

Editors and Affiliations

Appendices

Appendix A: Energy Expressions

The total energy of a system of atoms is given as a sum of various bonded and non-bonded energies for all the atoms:

$$ {E}^{total}=\underset{non- bonded}{\underbrace{E^{vdw}+{E}^{elec}}}+\underset{ bond ed}{\underbrace{E^{bond}+{E}^{angle}+{E}^{torsion}+{E}^{improper}}} $$
(18.1)

Energy minimization involves repeated evaluation of this expression, once during each minimization iteration. In the current discussion, only the non-bonded terms are mapped to the GPU and evaluated using the neighbor lists.

The non-bonded energy of each atom is the sum of the contributions due to the neighboring atoms within a cutoff distance. Non-bonded energy is a sum of the electrostatic and van der Waals energy terms. A variant of the Lennard-Jones 6–12 potential representing the van der Waals energy term is shown in Eq. (18.2)

$$ {E}_{ik}^{vdw}= ep{s}_{ik}\left(\frac{r{m}_{ik}^6}{r_{ik}^{12}}-\frac{{8 r{m}_{ik}^6}\!\left/ \!{{r}_c^6}\right.}{r_{ik}^6}+\frac{r{m}_{ik}^6}{r_c^{12}}\left(1+\frac{2{r}_{ik}^6}{r_c^6}\right)\right) $$
(18.2)
$$ ep{s}_{i k}= ep{s}_i. ep{s}_k $$
$$ r{m}_{i k}={\left( r{m}_i+ r{m}_k\right)}^2 $$

where eps i and rm i represent the van der Waals parameters of atom ‘i’, r ik is the distance between the atoms ‘i’ and ‘k’ and r c is the cut-off distance.

The electrostatic energy of a solute can be decomposed into two components; a sum of the self energies E self i of all the charges and a sum of pair-wise interaction energies E int ij [9] [Eq. (18.3)]

$$ {E}^{elec}={\displaystyle \sum_i{E}_i^{\mathit{self}}+{\displaystyle \sum_{i< j}{E}_{i j}^{\mathrm{int}}}} $$
(18.3)

Using the Analytic Continuum Electrostatics (ACE) model [9], the self-energy of an atom can be represented as a sum of its Born self-energy in the solvent and the sum of effective pair-wise interactions, E self ik , due to all the other solute atoms [see Eqs. (18.4) and (18.5)].

$$ {E}_i^{s elf}=\frac{q_i^2}{2{\varepsilon}_s{R}_i}+{\displaystyle \sum_{k\ne i}{E}_{i k}^{\mathit{self}}}$$
(18.4)
$$ {E}_{i k}^{\mathit{self}}=\tau {q}_i^2\left(\frac{e^{-\left({{r}_{i k}^2}\!\left/ \!{{\sigma}_{i k}^2}\right.\right)}}{\omega_{i k}}+\frac{{\tilde{V}}_k}{8\pi}{\left(\frac{r_{i k}^3}{r_{i k}^4+{\mu}_{i k}^4}\right)}^4\right) $$
(18.5)

where q i represents the charge on atom ‘i’, r ik is the distance between the two atoms, \( {\tilde{V}}_k \) is the size of the solute volume associated with atom ‘k’, ω ik and σ ik determine the height and width of the Gaussian that approximates E self ik , and μ ik is an atom-atom parameter.

The pair-wise interaction term of Eq. (18.3) is given by the generalized Born (GB) equation shown in Eq. (18.6), which is the sum of Coulomb’s law in a dielectric and the Born equation [10]

$$ {E}_{i j}^{\mathrm{int}}=332{\displaystyle \sum_{j\ne i}\frac{q_i{q}_j}{r_{i j}}}-166\tau {\displaystyle \sum_{j\ne i}\frac{q_i{q}_j}{\sqrt{r_{i j}^2+{\alpha}_i{\alpha}_j{e}^{-\left({{r}_{i j}^2}\!\left/ \!{4{\alpha}_i{\alpha}_j}\right.\right)}}}} $$
(18.6)

where α i and α j represent the Born radii for atoms ‘i’ and ‘j’, respectively. These in turn depend on the self energies of the atoms. The self energy of each individual atom thus needs to be computed before computing the pair-wise interactions.

Appendix B: Source Code

figure a

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Sukhwani, B., Herbordt, M.C. (2014). Increasing Parallelism and Reducing Thread Contentions in Mapping Localized N-Body Simulations to GPUs. In: Kindratenko, V. (eds) Numerical Computations with GPUs. Springer, Cham. https://doi.org/10.1007/978-3-319-06548-9_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-06548-9_18

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-06547-2

  • Online ISBN: 978-3-319-06548-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics