cpu and gpu parallel kramers-klein calculations

17
CPU and GPU parallel Kramers-Klein calculations B.I.Iaparov, A.N. Karmatsky, A.S. Moskvin Ural Federal University, Yekaterinburg

Upload: ural-pdc

Post on 12-Apr-2017

57 views

Category:

Science


0 download

TRANSCRIPT

Page 1: CPU and GPU parallel Kramers-Klein calculations

CPU and GPU parallel Kramers-Klein calculationsB.I.Iaparov, A.N. Karmatsky, A.S. Moskvin

Ural Federal University, Yekaterinburg

Page 2: CPU and GPU parallel Kramers-Klein calculations

1D Brownian motion of particle in an external potential field

• Reaction kinetics• Ion channel kinetics• Josephson tunneling • Etc.

http://daniandphy.wikidot.com/wiki:gnuplot

Page 3: CPU and GPU parallel Kramers-Klein calculations

Langevin equation

http://daniandphy.wikidot.com/wiki:gnuplot

Page 4: CPU and GPU parallel Kramers-Klein calculations

Kramers-Klein equation𝑚�̈�+𝑚𝛾 �̇�+𝑚𝑓 ′ (𝑥 )=𝑚 Γ (𝑡 )

Page 5: CPU and GPU parallel Kramers-Klein calculations

Kramers-Klein equation

• Parabolic equation in the v-direction• Hyperbolic equation in the x-direction

𝜕𝜌𝜕𝑡 =−𝑣 𝜕 𝜌𝜕 𝑥 + 𝑓 ′ (𝑥 ) 𝜕 𝜌

𝜕𝑣 +𝛾 𝜕 (𝑣 𝜌 )𝜕 𝑣 +

𝛾𝑘𝐵𝑇𝑚

𝜕2 𝜌𝜕 𝑣2

Page 6: CPU and GPU parallel Kramers-Klein calculations

Numerical method(Araujo et al.,2015)

Rectangular domain:

Uniform grid:

Page 7: CPU and GPU parallel Kramers-Klein calculations

Numerical method(Araujo et al.,2015)

Accuracy , conditionally stable(Araujo et al.,2015))

Page 8: CPU and GPU parallel Kramers-Klein calculations

Types of boundary conditions

• Dirichlet:

Page 9: CPU and GPU parallel Kramers-Klein calculations

Types of boundary conditions

• Dirichlet: • Absorbing:

Page 10: CPU and GPU parallel Kramers-Klein calculations

Types of boundary conditions

• Dirichlet: • Absorbing:

• Reflecting:

Page 11: CPU and GPU parallel Kramers-Klein calculations

Implementation details• PC: 4x Intel Core i5-4460 3.2 GHz, NVIDIA GTX 750• Uran supercomputer(NVIDIA Tesla M2050) from Institute of

Mathematics and Mechanics UrB RAS.• CPU program: C++(g++ -O3)• GPU: CUDA + g++ for host code

Page 12: CPU and GPU parallel Kramers-Klein calculations

Parallelization

• CPU: boundaries in series, interior in parallel• GPU: the whole domain in one kernel except Reflecting BCs• Interior: Stencil pattern• Boundaries: with Dirichlet and Absorbing BCs also Stencil• Reflecting BCs:

Page 13: CPU and GPU parallel Kramers-Klein calculations

Parallelization(Reflecting BCs)• Reflecting:

The first kernel calculates interior+half of boundaries(say with v > 0), the second one calculates the second half of boundaries(with v < 0)

Page 14: CPU and GPU parallel Kramers-Klein calculations

Comparison with analytic solution in case of parabolic potential(Risken Frank,1996)

𝜀(𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒𝑛𝑜𝑟𝑚)=8.3𝑒−4

Page 15: CPU and GPU parallel Kramers-Klein calculations

Performance resultsDirichlet Absorbing Reflecting

1x CPU 592.6 s 601.2 s 600.8 s

4x CPU 218.3 s (2.7x) 226.74 s (2.7x) 220 s(2.7x)

1x GPU(GTX 750) 114.7 s (5.2x) 116.6 s(5.2x) 122 s(4.9x)

1x GPU(Tesla M2050)

39.8 s (14.9x) 40 s(15x) 43.9 s(13.7x)

Page 16: CPU and GPU parallel Kramers-Klein calculations

Conclusions

• We parallelized a scheme from(Araujo et al.,2015) on CPU and GPU • We showed that both CPU and GPU parallel computing provide a

signifcant gain in the solving time of the Kramers-Klein equation. Even home PC's GPU can solve the equation for an acceptable time.• Calculations on different grids have shown that duration of solving

depends linearly on

Page 17: CPU and GPU parallel Kramers-Klein calculations

Thank you for attention!