Top Banner
GENGA : G ravitational E ncounters in N -body simulations with G PU A cceleration Institute for Computational Science University of Zürich Perspectives of GPU Computing in Physics and Astrophysics Roma 2014 Simon Grimm Joachim Stadel [email protected]
22

GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

Sep 20, 2018

Download

Documents

buidan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

GENGA: Gravitational Encounters in N-bodysimulations with GPU Acceleration

Institute for Computational ScienceUniversity of Zürich

Perspectives of GPU Computing in Physics and AstrophysicsRoma 2014

Simon GrimmJoachim Stadel

[email protected]

Page 2: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

2/22Simon Grimm

Outline

● Physical problem

● Theory and integration scheme

● Some details about the kernels

● Applications

Page 3: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

3/22Simon Grimm

Overview

Goals:Study the formation process of terrestrial planetary systems due to planetesimal dynamics.Analyze the long term evolution of (exo-)planetary systems.

Requirements: Good energy conservation over billions of time steps.Resolve close encounters accurately.Collisions between bodies are possible.

Limits:The number of massive bodies is limited to 2048 due to the close encounter handling of the algorithm.

Page 4: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

4/22Simon Grimm

GENGA

GENGA supports 3 Computational Modes: ● Up to 2048 massive bodies

● Up to 1 million test particles

● Up to 100000 parallel small simulations

We need to study relatively small simulations, but we need a lot of them to cover a large parameter space.

All of the computation is done on the GPU to avoid memory transfer with the CPU.

Simulations run on only one node, could use multiple GPUs.

Page 5: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

5/22Simon Grimm

Theory: The hybrid symplectic integrator

Using democratic coordinates:(Heliocentric positions and barycentric velocities)

Drift Keplerian arcsanalytical with FG

Use direct n-body integrator if K < 1

KickO(N2)

Sun Kick

Page 6: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

6/22Simon Grimm

Close encounter pairs form groups

Rcrit = max(3 * RHill, 0.4 *dt * v)

Page 7: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

7/22Simon Grimm

Close encounter pairs form groups

Limit of N = 2048

Rcrit = max(3 * RHill, 1.5 *dt * v)

Page 8: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

8/22Simon Grimm

The integration scheme

No close encounter candidates With close encounter candidates

Prechecker findsCE candidates forthe next time step

Polynomialinterpolation

Parallel groupfinding

algorithm

Page 9: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

9/22Simon Grimm

The Kick kernel

● The number of bodies is too small to usea standard N2 kernel as described in e.g. Gems 3

● We need more work to be done in paralleland perform the summations in shared memory withinone thread block.

● We need different versions of the kernel, depending onthe number of bodies.

Page 10: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

10/22Simon Grimm

All kernels are optimized for a certain number of bodies

switch(N){case 16: D.step_16(t);break;case 32: D.step_32(t);break;case 64: D.step_64(t);break;case 128: D.step_128(t);break;case 256: D.step_256(t);break;case 512: D.step_512(t);break;case 1024: D.step_1024(t);break;case 2048: D.step_2048(t);break;

}

Page 11: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

11/22Simon Grimm

Find independent close encounter groups in parallel

Page 12: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

12/22Simon Grimm

Timing of the main kernels

Page 13: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

13/22Simon Grimm

Comparison between different GPUs

Page 14: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

14/22Simon Grimm

Timing of the main kernelsfor the multi simulation mode

Page 15: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

15/22Simon Grimm

Comparison between different GPUsfor the multi simulation mode

Page 16: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

16/22Simon Grimm

Comparison with pkdgrav and Mercury

Page 17: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

17/22Simon Grimm

Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for a set of 40

simulations with 32 planetesimals.

Page 18: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

18/22Simon Grimm

Tools in GENGA:

● Analytic Gas disc modelAdapted from Morishima et al. 2010

● Poincaré surface of section● Fraction of time spent in a-e limits

Count how much time a body spend in a specified semi-major-axis and eccentricity regime.

● a-e gridPlot how long regions in semi-major-axis and eccentricity are populated from bodies.

● Switch for exact reproduction of random rounding errors.For studying chaotic systems the order of arithmetic operations can be fixed to reproduce exact the same results

● openGL visualization

http://www.youtube.com/watch?v=74O-8P49iJk

http://www.youtube.com/watch?v=a_4cjXVDEAw

Page 19: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

19/22Simon Grimm

Planet formation with a gas disc

Page 20: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

20/22Simon Grimm

Stability analysis of addition super Earths in exoplanetary systems

Elser et Al. 2013

Page 21: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

21/22Simon Grimm

Use test particles to find stable orbits withina planetary system

Page 22: GENGA: Gravitational Encounters in N-body … · Comparison with pkdgrav and Mercury. Simon Grimm 17/22 Comparison of the energy conservation between GENGA, pkdgrav and Mercury, for

22/22Simon Grimm

Conclusions

● GENGA runs up to 30 times faster than a CPU code (Mercury)

● We want to run many relatively small simulations

● A new algorithm is needed for higher N

● The best hardware setup is one node with many GPUs.

● GENGA is available at:

https://bitbucket.org/sigrimm/genga