cpu and gpu parallel kramers-klein calculations
Post on 12-Apr-2017
57 Views
Preview:
TRANSCRIPT
CPU and GPU parallel Kramers-Klein calculationsB.I.Iaparov, A.N. Karmatsky, A.S. Moskvin
Ural Federal University, Yekaterinburg
1D Brownian motion of particle in an external potential field
• Reaction kinetics• Ion channel kinetics• Josephson tunneling • Etc.
http://daniandphy.wikidot.com/wiki:gnuplot
Langevin equation
http://daniandphy.wikidot.com/wiki:gnuplot
Kramers-Klein equation𝑚�̈�+𝑚𝛾 �̇�+𝑚𝑓 ′ (𝑥 )=𝑚 Γ (𝑡 )
Kramers-Klein equation
• Parabolic equation in the v-direction• Hyperbolic equation in the x-direction
𝜕𝜌𝜕𝑡 =−𝑣 𝜕 𝜌𝜕 𝑥 + 𝑓 ′ (𝑥 ) 𝜕 𝜌
𝜕𝑣 +𝛾 𝜕 (𝑣 𝜌 )𝜕 𝑣 +
𝛾𝑘𝐵𝑇𝑚
𝜕2 𝜌𝜕 𝑣2
Numerical method(Araujo et al.,2015)
Rectangular domain:
Uniform grid:
Numerical method(Araujo et al.,2015)
Accuracy , conditionally stable(Araujo et al.,2015))
Types of boundary conditions
• Dirichlet:
Types of boundary conditions
• Dirichlet: • Absorbing:
Types of boundary conditions
• Dirichlet: • Absorbing:
• Reflecting:
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
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:
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)
Comparison with analytic solution in case of parabolic potential(Risken Frank,1996)
𝜀(𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒𝑛𝑜𝑟𝑚)=8.3𝑒−4
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)
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
Thank you for attention!
top related