Parallel implementation of Particle-in-Cell algorithm using Julia programming language

Wiktor Łodyga

supervisor: Jacek Starzyński



The purpose of this study was to create an original GPU implementation of a Particle-in-Cell (PIC) algorithm, which is a versatile method for simulating charged particles. Presentation covers the results achieved with the standard, collisionless form of algorithm. Starting from serial CPU implementation the work has been carried out to speed up the computation, especially for the problems of bigger size. Measurements of the performance and assessment of the correctness of the implementation has been performed using a simple 1D problem of two counter-propagating streams of charged particles. The final results of multithreaded implementation, were compared with initial, serial CPU code. Both implementations has been written solely in Julia programming language. The CUDA.jl library was used to prepare the GPU-specific code. Thanks to the features of CUDA.jl, such as the original compiler for writing CUDA kernels in pure Julia or user-friendly array abstractions, the two-language problem, could have been solved. The study takes advantage of library and shows how, the codebase developed for the CPU can be easily re-used for the GPU computations. In order to assure reasonable GPU utilization, a kernel profiling has been performed in NVIDIA Nsight Compute tool. During the final experiments a series of simulations, with the increasing number of particles in the system, have been performed. The resulting speedups over initial CPU-specific implementation are presented.