The Particle-in-Cell (PIC) method is a Particle-Mesh technique that allows to efficiently simulate kinetic models. Among others applications, space weather simulations could be tackled by massively parallel Particle-in-Cell codes, to model the dynamics of space plasma disturbances.
However, realistic Particle-Mesh plasma simulations require huge data sets and are computationally expensive. This is why high scalability must be achieved in order to perform the massively parallel plasma simulations required for space weather purposes. In Particle-Mesh techniques such as PIC simulations, computational particles are free to move on a fixed grid mesh and can show important inhomogeneity during computation. This results in an imbalanced work load between different threads that must be tackled.
This paper reports on a 2D electrostatic PIC code in Unified Parallel C, developed for both plasma and gravitational simulations. The algorithm includes dynamic load-balancing capabilities. We compare different load-balancing strategies: one based on the particle distribution, and one based on computation time. We also present results of the simulation of the classical two-stream instability, and a simulation of a gravitational clustering experiment triggered by the Jeans instability. It is shown that both dynamic load-balancing based on computation time or on the number of particles are efficient for Particle-Mesh simulations where high particle inhomogeneities occur.