Volume 11, no. 1Pages 124 - 136

New Features of Parallel Implementation of N-Body Problems on GPU

S.S. Khrapov, S.A. Khoperskov, A.V. Khoperskov
This paper focuses on the parallel implementation of a direct N-body method (particle-particle algorithm) and the application of multiple GPUs for galactic dynamics simulations. Application of a hybrid OpenMP-CUDA technology is considered for models with a number of particles N sim 10^5 div 10^7. By means of N-body simulations of gravitationally unstable stellar galactic we have investigated the algorithms parallelization efficiency for various Nvidia Tesla graphics processors (K20, K40, K80). Particular attention was paid to the parallel performance of simulations and accuracy of the numerical solution by comparing single and double floating-point precisions (SP and DP). We showed that the double-precision simulations are slower by a factor of 1,7 than the single-precision runs performed on Nvidia Tesla K-Series processors. We also claim that application of the single-precision operations leads to incorrect result in the evolution of the non-axisymmetric gravitating N-body systems. In particular, it leads to significant quantitative and even qualitative distortions in the galactic disk evolution. For instance, after 10^4 integration time steps for the single-precision numbers the total energy, momentum, and angular momentum of a system with N = 2^{20} conserve with accuracy of 10^{-3}, 10^{-2} and 10^{-3} respectively, in comparison to the double-precision simulations these values are 10^{-5}, 10^{-15} and 10^{-13}, respectively. Our estimations evidence in favour of usage of the second-order accuracy schemes with double-precision numbers since it is more efficient than in the fourth-order schemes with single-precision numbers.
Full text
Keywords
Multi-GPU; OpenMP-CUDA; GPU-Direct; Nvidia Tesla; N-body; single and double precision numerical simulation; collisionless system; gravitational instability.
References
1. Fridman A.M., Khoperskov A.V. Physics of Galactic Disks. Cambridge: Cambridge International Science Publishing, 2013.
2. Kennedy G.F., Meiron Y., Shukirgaliyev B., Panamarev T., Berczik P. et al. The DRAGON Simulations: Globular Cluster Evolution with a Million Stars. Monthly Notices of the Royal Astronomical Society, 2016, vol.,458, no.,2, pp. 1450-1465. DOI: 10.1093/mnras/stw274
3. Khrapov S., Khoperskov A. Smoothed-Particle Hydrodynamics Models: Implementation Features on GPUs. Communications in Computer and Information Science, 2017, vol. 793, pp. 266-277. DOI: 10.1007/978-3-319-71255-0_21
4. Smirnov A.A., Sotnikova N.Ya., Koshkin A.A. Simulations of Slow Bars in Anisotropic Disk Systems. Astronomy Letters, 2017, vol. 43, no. 2, pp. 61-74. DOI: 10.1134/S1063773717020062
5. Comparat J., Prada F., Yepes G., Klypin A. Accurate Mass and Velocity Functions of Dark Matter Haloes. Monthly Notices of the Royal Astronomical Society, 2017, vol. 469, no. 4, pp. 4157-4174. DOI: 10.1093/mnras/stx1183
6. Knebe A., Stoppacher D., Prada F., Behrens C., Benson A. et al. Multidark-Galaxies: Data Release and First Results. Monthly Notices of the Royal Astronomical Society, 2018, vol. 474, no. 4, pp. 5206-5231. DOI: 10.1093/mnras/stx2662
7. Hwang J.-S., Park C. Effects of Hot Halo Gas on Star Formation and Mass Transfer During Distant Galaxy-Galaxy Encounters. The Astrophysical Journal, 2015, vol. 805, pp. 131-149. DOI: 10.1088/0004-637X/805/2/131
8. Portaluri E., Debattista V., Fabricius M., Cole D.R., Corsini E. et al. The Kinematics of sigma-drop Bulges from Spectral Synthesis Modelling of a Hydrodynamical Simulation. Monthly Notices of the Royal Astronomical Society, 2017, vol. 467, no. 1, pp. 1008-1015. DOI: 10.1093/mnras/stx172
9. Khoperskov A.V., Just A., Korchagin V.I., Jalali M.A. High Resolution Simulations of Unstable Modes in a Collisionless Disc. Astronomy and Astrophysics, 2007, vol. 473, pp. 31-40. DOI: 10.1051/0004-6361:20066512
10. Gelato S., Chernoff D.F., Wasserman I. An Adaptive Hierarchical Particle-Mesh Code with Isolated Boundary Conditions. The Astrophysical Journal, 1997, vol. 480, pp. 115-131. DOI: 10.1086/303949
11. Barnes J., Hut P. A Hierarchical O(Nlog N) Force-Calculation Algorithm. Nature, 1986, vol. 324, pp. 446-449. DOI: 10.1038/324446a0
12. Greengard L. The Numerical Solution of the N-Body Problem. Computers in physics, 1990, vol. 4, pp. 142-152. DOI: 10.1063/1.4822898
13. Huang S.-Y., Spurzem R., Berczik P. Performance Analysis of Parallel Gravitational N-Body Codes on Large Gpu Clusters. Research in Astronomy and Astrophysics, 2016, vol. 16, no. 1, p. 11. DOI: 10.1088/1674-4527/16/1/011
14. Steinberg O.B. Circular Shift of Loop Body - Programme Transformation, Promoting Parallelism. Bulletin of the South Ural State University. Series: Mathematical Modelling, Programming and Computer Software, 2017, vol. 10, no. 3, pp. 120-132. DOI: 10.14529/mmp170310
15. Khoperskov A., Bizyaev D., Tiurina N., Butenko M. Numerical Modelling of the Vertical Structure and Dark Halo Parameters in Disc Galaxies. Astronomische Nachrichten, 2010, vol. 331, pp. 731-745. DOI: 10.1002/asna.200911402
16. Khoperskov A.V., Khoperskov S.A., Zasov A.V., Bizyaev D.V., Khrapov S.S. Interaction between Collisionless Galactic Discs and Nonaxissymmetric Dark Matter Haloes. Monthly Notices of the Royal Astronomical Society, 2013, vol. 431, pp. 1230-1239. DOI: 10.1093/mnras/stt245
17. Khoperskov S.A., Vasiliev E.O., Khoperskov A.V., Lubimov V.N. Numerical Code for Multi-Component Galaxies: from N-Body to Chemistry and Magnetic Fields. Journal of Physics: Conference Series, 2014, vol. 510, pp. 1-13. DOI: 10.1088/1742-6596/510/1/012011
18. Rodionov S.A., Athanassoula E., Sotnikova N.Ya. An Iterative Method for Constructing Equilibrium Phase Models of Stellar Systems. Monthly Notices of the Royal Astronomical Society, 2009, vol. 392, no. 2, pp. 904-916. DOI: 10.1111/j.1365-2966.2008.14110.x
19. Bellemana R.G., Jeroen B., Simon F., Portegies Z. High Performance Direct Gravitational N-Body Simulations on Graphics Processing Units: An Implementation in CUDA. New Astronomy, 2008, vol. 13, pp. 103-112. DOI: 10.1016/j.newast.2007.07.004
20. Griv E., Wang H.-H. Density Wave Formation in Differentially Rotating Disk Galaxies: Hydrodynamic Simulation of the Linear Regime. New Astronomy, 2014, vol. 30, pp. 8-27. DOI: 10.1016/j.newast.2014.01.001
21. Romeo A., Falstad N. A Simple and Accurate Approximation for the Q Stability Parameter in Multicomponent and Realistically Thick Discs. Monthly Notices of the Royal Astronomical Society, 2013, vol. 433, no. 2, pp. 1389-1397. DOI: 10.1093/mnras/stt809