Том 11, № 1Страницы 124 - 136

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

S.S. Khrapov, S.A. Khoperskov, A.V. Khoperskov
Рассмотрены особенности параллельной реализации прямого гравитационного моделирования N-тел на нескольких GPU с использованием технологии GPU-Direct. Подробно описан параллельный алгоритм решения задачи N-тел, основанный на гибридной технологии распараллеливания OpenMP-CUDA с количеством частиц Nsim 10^5div 10^7. Исследована эффективность распараллеливания нашего алгоритма для различных GPU линейки Nvidia Tesla (K20, K40, K80) при моделировании динамики гравитационно-неустойчивого звездного галактического диска. Изучена производительность и точность моделирования при использовании чисел одинарной и двойной точности. Так, например, для процессора Nvidia Tesla K80 время вычислений с двойной точностью оказалась всего лишь в 1,85 раз больше чем для одинарной точности. Показано, что использовать числа с одинарной точностью при моделировании на GPU сильно несимметричных систем взаимодействующих N-тел схемами второго порядка точности по времени некорректно, так как это приводит к значительным количественным и качественным искажениям результата. Так, например, для чисел одинарной точности после 10^4 шагов по времени полные энергия, импульс и момент импульса системы N-тел (N=2^{20}) сохранились с точностью менее 2 cdot 10^{-3}, 4cdot 10^{-2} и 7cdot 10^{-3}, соответственно. Для чисел двойной точности эти законы сохранения выполнялись с точностью более 5cdot 10^{-5}, 10^{-15} и 10^{-13}, соответственно. Наши оценки показывают, что по шкале производительность-точность использование схем второго порядка точности по времени наряду с числами двойной точности оказывается на 20-30
Полный текст
Ключевые слова
Multi-GPU; OpenMP-CUDA; GPU-Direct; Nvidia Tesla; задача N-тел; одинарная и двойная точность численных решений; звездный галактический диск; гравитационная неустойчивость.
Литература
1. Fridman, A.M. Physics of Galactic Disks / A.M. Fridman, A.V. Khoperskov. - Cambridge: Cambridge International Science Publishing, 2013.
2. Kennedy, G.F. The DRAGON Simulations: Globular Cluster Evolution with a Million Stars / G.F. Kennedy, Y. Meiron, B. Shukirgaliyev, T. Panamarev, P. Berczik et al // Monthly Notices of the Royal Astronomical Society. - 2016. - V. 458, № 2. - P. 1450-1465.
3. Khrapov S., Khoperskov A. Smoothed-Particle Hydrodynamics Models: Implementation Features on GPUs //Communications in Computer and Information Science. - 2017. - V. 793, pp.,266-277.
4. Smirnov, A.A. Simulations of Slow Bars in Anisotropic Disk Systems / A.A. Smirnov, N.Ya. Sotnikova, A.A. Koshkin // Astronomy Letters. - 2017. - V. 43, № 2. - P. 61-74.
5. Comparat, J. Accurate Mass and Velocity Functions Of Dark Matter Haloes / J. Comparat, F. Prada, G. Yepes, A. Klypin // Monthly Notices of the Royal Astronomical Society. - 2017. - V. 469, № 4. - P. 4157-4174.
6. Knebe, A. Multidark-Galaxies: Data Release and First Results / A. Knebe, D. Stoppacher, F. Prada, C. Behrens, A. Benson et al. // Monthly Notices of the Royal Astronomical Society. - 2018. - V. 474, № 4. - P. 5206-5231.
7. Hwang, J.-S. Effects of Hot Halo Gas on Star Formation and Mass Transfer During Distant Galaxy-Galaxy Encounters / J.-S. Hwang, C. Park // The Astrophysical Journal. - 2015. - V. 805. - pp. 131-149.
8. Portaluri, E. The Kinematics of sigma-Drop Bulges from Spectral Synthesis Modelling of a Hydrodynamical Simulation / E. Portaluri, V. Debattista, M. Fabricius, D.R. Cole, E. Corsini et al // Monthly Notices of the Royal Astronomical Society. - 2017. - V. 467, № 1. - P. 1008-1015.
9. Khoperskov, A.V. High Resolution Simulations of Unstable Modes in a Collisionless Disc / A.V. Khoperskov, A. Just, V.I. Korchagin, M.A. Jalali // Astronomy and Astrophysics. - 2007. - V. 473. - pp. 31-40.
10. Gelato, S. An Adaptive Hierarchical Particle-Mesh Code with Isolated Boundary Conditions / S. Gelato, D.F. Chernoff, I. Wasserman // The Astrophysical Journal. - 1997. - V. 480. - P. 115-131.
11. Barnes, J. A Hierarchical O(Nlog N) Force-Calculation Algorithm / J. Barnes, P. Hut // Nature. - 1986. - V. 324. - P. 446-449.
12. Greengard, L. The Numerical Solution of the N-Body Problem / L. Greengard // Computers in Physics. - 1990. - V. 4. - P. 142-152.
13. Huang, S.-Y. Performance Analysis of Parallel Gravitational N-Body Codes on Large Gpu Clusters / S.-Y. Huang, R. Spurzem, P. Berczik // Research in Astronomy and Astrophysics. - 2016. - V. 16, № 1. - P. 11.
14. Steinberg, O.B. Circular Shift of Loop Body - Programme Transformation, Promoting Parallelism / O.B. Steinberg // Вестник ЮУрГУ. Серия: Математическое моделирование и программирование. - 2017. - Т. 10, № 3. - С. 120-132.
15. Khoperskov, A. Numerical Modelling of the Vertical Structure and Dark Halo Parameters in Disc Galaxies / A. Khoperskov, D. Bizyaev, N. Tiurina, M. Butenko // Astronomische Nachrichten. - 2010. - V. 331. - P. 731-745.
16. Khoperskov, A.V. Interaction between Collisionless Galactic Discs and Nonaxissymmetric Dark Matter Haloes / A.V. Khoperskov, S.A. Khoperskov, A.V. Zasov, D.V. Bizyaev, S.S. Khrapov // Monthly Notices of the Royal Astronomical Society. - 2013. - V. 431. - P. 1230-1239.
17. Khoperskov, S.A. Numerical Code for Multi-Component Galaxies: from N-Body to Chemistry and Magnetic Fields / S.A. Khoperskov, E.O. Vasiliev, A.V. Khoperskov, V.N. Lubimov // Journal of Physics: Conference Series. - 2014. - V. 510. - P. 1-13.
18. Rodionov, S.A. An Iterative Method for Constructing Equilibrium Phase Models of Stellar Systems / S.A. Rodionov, E. Athanassoula, N.Ya. Sotnikova // Monthly Notices of the Royal Astronomical Society. - 2009. - V. 392, № 2. - P. 904-916.
19. Bellemana, R.G. High Performance Direct Gravitational N-body Simulations on Graphics Processing Units: an Implementation in CUDA / R.G. Bellemana, B. Jeroen, F. Simon, Z. Portegies // New Astronomy. - 2008. - V. 13. - P. 103-112.
20. Griv, E. Density Wave Formation in Differentially Rotating Disk Galaxies: Hydrodynamic Simulation of the Linear Regime / E. Griv, H.-H. Wang // New Astronomy. - 2014. - V. 30. - P. 8-27.
21. Romeo, A. A Simple and Accurate Approximation for the Q Stability Parameter in Multicomponent and Realistically Thick Discs / A. Romeo, N. Falstad // Monthly Notices of the Royal Astronomical Society. - 2013. - V. 433, № 2. - P. 1389-1397.