1D WAVE EQUATION OPENCL-BASED INTEGRATION

Maxim Belov1, Alex Halavanau1

1 Faculty of Physics, Belarusian State University, Minsk, Belarus

In the presented research we discuss the parallel implementation of the method of lines for hyperbolic wave equation with one spatial dimension:

$$\partial_{tt}\phi - \partial_{xx}\phi = 0 \tag{1}$$

We use general purpose graphic processor units (GPGPU) and API of OpenCL library. We illustrated the effectivness of graphic card use for PDE integration computations by comparing to CPU-based implementations. We used the method of lines as the most simple example for parallel PDE integration. The method allows to construct the solution of desired precision and errors in spatial and time variables and can be easily ammended to 2D and 3D equations.

GPUs are slowly adopted by the computational physics and are still mainly used to speed up Monte Carlo simulations in high energy physics. Implementing Monte Carlo simulations on GPU is natural, because it is obvious how to parallelize the problem [1]. A plenty of computational physics tasks involve solution of PDE, and Solving PDEs is usually significantly harder. Several groups of methods can be pointed out.

First and the most naive approach is to replace all derivatives with apropriate finite differences; this leads to either explicit or implicit methods. The former ones have convergence issuses, the latter ones lead to many-diagonal matrix linear equation systems for every time step. One can utilize GPU by applying modern algorithms based on cyclic reduction or recursive doubling. We followed another way of solving PDE which is much more easier to implement and parallelize - the method of lines. If one discretizes the space and leaves the time continuous, he will obtain the system of ordinary differential equations. This system is then can be integrated by any of stepping methods (Runge-Kutta, Adams, etc.) [2]. Depending on discretization scheme some other methods can be constructed, for example the leap-frog and the Crank-Nicholson methods. We have applied the most simple form of the method of lines. Nevertheless, it uses high order schemes and therefore provides us with the robust data. The used finite difference for the second order spatial derivative is following:

$$\frac{d^2\phi_n}{dt^2} \approx \frac{1}{12(\Delta X)^2} (-\phi_{n-2} + 16\phi_{n-1} - 30\phi_n + 16\phi_{n+1} - \phi_{n+2}) \tag{2}$$

It defines corresponding system of 2N first order ordinary differential equations

We decided to use OpenCL API because it works on any GPGPU hardware and supports popular operating systems. Well documented SDK [3] makes the number of applications of this library in computational physics countless. We used our solver to integrate famous non-linear $\phi^4$ and $\phi^6$ potential systems and have obtained precise numerical data.

The method of lines utilizes the true parallel manner of PDE integrating and has wide range of applications in hyperbolic, parabolic and mixed-type equations. Our results prove that efficient programming on GPU can sufficiently speed up the process of numerical integration and open parallel computing world to everyone. We plan to extend this technique for higher dimensional systems.


[1] Daniel Egloff, High Performance Finite Difference PDE Solvers on GPUs QuantAlea GmbH, Switzerland, 2010.

[2] M. A. Green, Time Dependent Problems and Difference Methods Bertil Gustafsson, Heinz-Otto Kreiss, Joseph Oliger. Pure and Applied Math, Wiley, 1996.

[3] Accelerated Parallel Processing (APP) AMD SDK