POSIX threads parallelization for example of Particle-In-Cell density calculations in plasma computer simulations

  • Authors:
  • Anna Sasak;Marcin Brzuszek

  • Affiliations:
  • Institute of Computer Science, Maria Curie Sklodowska University, pl. M. Curie-Sklodowskiej 1, 20-031 Lublin, Poland;Institute of Computer Science, Maria Curie Sklodowska University, pl. M. Curie-Sklodowskiej 1, 20-031 Lublin, Poland

  • Venue:
  • Annales UMCS, Informatica
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

The TRQR program [1-4] simulates trajectories of charged particles (electrons or ions) in the electromagnetic field. TRQR is based on the Particle-In-Cell method whose basic guideline is the use of computational particles (called macro particles) that represent a large number of real particles of the same kind moving in the same direction. The program calculates particles charge density distribution and potential distribution for chosen ion sources, analyses particles behaviour in the electromagnetic field, describes the process of beams from the source extraction. A number of factors influences simulation results. In order to improve efficiency the program has been parallelized. This paper presents the process of converting chosen parts of the TRQR program into the multi-thread version. In the first step the program was moved from Fortran 77 to C++. Then it was parallelized using the Pthread library with the standard API for C++ contained in the POSIX IEEE 1003.1c standard. Each of threads has its own stack, set of registers, program counter, individual data, local variables, state information. All threads of particular process share one address space, general signal operations, virtual memory, data, input and output. The Mutex functions were used as a synchronization mechanism. This paper presents the analysis of a particular piece of main program that implements computations of particles density distribution. The paper presents execution time dependencies for different simulation parameters such as: the number of macro particles, size of the simulation mesh and the number of used threads.