Preview

Vestnik NSU. Series: Information Technologies

Advanced search

Reordering Optimization for GPU Implementation of Particle-in-Cell Method

https://doi.org/10.25205/1818-7900-2019-17-1-82-89

Abstract

Particle-In-Cell (PIC) method is widely used for plasma simulation and the GPUs appear to be the most efficient way to run this method. In this work we propose a technique that enables to speedup one of the most time-consuming operations in the GPU implementation of the PIC method. The operation is particle reordering, or redistribution of particles between cells, which is performed after pushing. The reordering operation provides data locality which is the key performance issue of the PIC method. We propose to divide the reordering into two stages. First, gather the particles that are going to leave a particular cell into buffer arrays, the number of arrays being equal to number of neighbour cells (26 for 3D case). Second, each neighbour cell copies the particles from the necessary array to her own particle array. Since the second operation is done in 26 threads independently with no synchronization, waiting and involves no critical sections, semaphores, mutexes, atomic operations etc. It results in the more than 10 times reduce of the reordering time compared to the straightforward reordering algorithm. Futhermore, we eliminate the 26 buffer arrays in the following way: the particles are just labeled instead of moving to buffer array. It enables to keep all the advantages with no memory wasted for buffer arrays.

About the Authors

A. A. Romanenko
Novosibirsk State University
Russian Federation


A. V. Snytnikov
Novosibirsk State University; Institute of Computational Mathematics and Mathematical Geophysics SB RAS
Russian Federation


References

1. Бэдсел Ч., Лэнгдон А. Физика плазмы и численное моделирование. М.: Энергоатомиздат, 1989.

2. Birdsall C. K., Langdon A. Plasma Physics via Computer Simulation. CRC Press, 2004.

3. Григорьев Ю. Н., Вшивков В. А., Федорук М. П. Численное моделирование методами частиц в ячейках. Новосибирск: Изд-во СО РАН, 2004.

4. Grigoryev Yu. N., Vshivkov V. A., Fedoruk M. P. Numerical Particle-in-Cell Methods. Theory and applications. Utrech, Boston, 2002.

5. Astrelin V. T., Burdakov A. V., Postupaev V. V. Generation of ion-acoustic waves and suppresion of heat transport during plasma heating by an electron beam. Plasma Physics Reports, 1998, vol. 24 (5), p. 414-425.

6. Боресков А. В., Харламов А. А. Основы работы с технологией CUDA. ДМК Пресс, 2010.

7. Burau H., Widera R., Hoenig W., Juckeland G., Debus A., Kluge T., Schramm U., Cowan T., Sauerbrey R., Bussmann M. PIConGPU: A Fully Relativistic Particle-in-Cell Code for a GPU Cluster. IEEE Transactions on Plasma Science, 2010, vol. 38, p. 2831-2839. DOI 10.1109/TPS.2010.2064310

8. Rossi F., Londrillo P., Sgattoni A., Sinigardi S., Turchetti G. Towards robust algorithms for current deposition and dynamic load-balancing in a GPU particle in cell code. In: AIP Conference Proceedings, 2012, vol. 1507, iss. 1, p. 184-192. DOI 10.1063/1.4773692

9. Kong X., Huang M., Ren Ch., Decyk V. Particle-in-cell simulations with charge-conserving current deposition on graphic processing units. Journal of Computational Physics, 2011, vol. 230, iss. 4, p. 1676-1685. DOI 10.1016/j.jcp.2010.11.032

10. Rieke M., Trost T., Grauer R. Coupled Vlasov and two-fluid codes on GPUs. Journal of Computational Physics, 2015, vol. 283, p. 436-452. DOI 10.1016/j.jcp.2014.12.016

11. Месяц Е. А., Снытников А. В., Лотов К. В. О выборе числа частиц в методе частиц-в-ячейках для моделирования задач физики плазмы // Вычислительные технологии, 2013. Т. 18, № 6. С. 83-96.

12. Lotov K. V., Timofeev I. V., Mesyats E. A., Snytnikov A. V., Vshivkov V. A. Note on quantitatively correct simulations of the kinetic beam-plasma instability. Physics of Plasmas, 2015, vol. 22, no. 2, p. 024502. DOI 10.1063/1.4907223.

13. Tskhakaya D., Schneider R. Optimization of PIC codes by improved memory management. Journal of Computational Physics, 2007, vol. 225, iss. 1, p. 829-839. DOI 10.1016/j.jcp. 2007.01.002.


Review

For citations:


Romanenko A.A., Snytnikov A.V. Reordering Optimization for GPU Implementation of Particle-in-Cell Method. Vestnik NSU. Series: Information Technologies. 2019;17(1):82-89. (In Russ.) https://doi.org/10.25205/1818-7900-2019-17-1-82-89

Views: 68


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.


ISSN 1818-7900 (Print)
ISSN 2410-0420 (Online)