22
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]

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

  • Upload
    buidan

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

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]

2/22Simon Grimm

Outline

● Physical problem

● Theory and integration scheme

● Some details about the kernels

● Applications

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.

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.

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

6/22Simon Grimm

Close encounter pairs form groups

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

7/22Simon Grimm

Close encounter pairs form groups

Limit of N = 2048

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

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

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.

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;

}

11/22Simon Grimm

Find independent close encounter groups in parallel

12/22Simon Grimm

Timing of the main kernels

13/22Simon Grimm

Comparison between different GPUs

14/22Simon Grimm

Timing of the main kernelsfor the multi simulation mode

15/22Simon Grimm

Comparison between different GPUsfor the multi simulation mode

16/22Simon Grimm

Comparison with pkdgrav and Mercury

17/22Simon Grimm

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

simulations with 32 planetesimals.

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

19/22Simon Grimm

Planet formation with a gas disc

20/22Simon Grimm

Stability analysis of addition super Earths in exoplanetary systems

Elser et Al. 2013

21/22Simon Grimm

Use test particles to find stable orbits withina planetary system

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