Abstract
The Python programming language has established itself as a popular alternative for implementing scientific computing workflows. Its massive adoption across a wide spectrum of disciplines has created a strong community that develops tools for solving complex problems in science and engineering. In particular, there are several parallel programming libraries for Python codes that target multicore processors. We aim at comparing the performance and scalability of a subset of three popular libraries (Multiprocessing, PyMP, and Torcpy). We use the Particle-in-cell (PIC) method as a benchmark. This method is an attractive option for understanding physical phenomena, specially in plasma physics. A pre-existing PIC code implementation was modified to integrate Multiprocessing, PyMP, and Torcpy. The three tools were tested on a manycore and on a multicore processor by running different problem sizes. The results obtained consistently indicate that PyMP has the best performance, Multiprocessing showed a similar behavior but with longer execution times, and Torcpy did not properly scale when increasing the number of workers. Finally, a just-in-time (JIT) alternative was studied by using Numba, showing execution time reductions of up to 43%.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Adekanmbi, O.G.: Performance comparisons for Python libraries in parallel computing and physical simulation. In: 2022 ASEE Gulf Southwest Annual Conference. ASEE Conferences, Prairie View, Texas, March 2022. https://peer.asee.org/39194
Blandón, J.S., Grisales, J.P., Riascos, H.: Electrostatic plasma simulation by particle-in-cell method using ANACONDA package. J. Phys. Conf. Ser. 850, 012007 (2017)
Fink, Z., Liu, S., Choi, J., Diener, M., Kale, L.V.: Performance evaluation of Python parallel programming models: charm4Py and mpi4py (2021). https://doi.org/10.48550/ARXIV.2111.04872, https://arxiv.org/abs/2111.04872
Galvez, J.J., Senthil, K., Kale, L.: CharmPy: a Python parallel programming model. In: 2018 IEEE International Conference on Cluster Computing (CLUSTER), pp. 423–433 (2018). https://doi.org/10.1109/CLUSTER.2018.00059
Fehske, H., Schneider, R., Weiße, A.: Computational Many-Particle Physics. Springer, Cham (2008)
(IBM) Integrated Baseboard Management Controller (iBMC) : torcpy: supporting task-based parallelism in Python (2019). https://github.com/IBM/torcpy
Kadochnikov, I.: Accelerating the particle-in-cell method of plasma and particle beam simulation using CUDA tools. In: 27th International Symposium on Nuclear Electronics and Computing (NEC 2019) (2019)
Kim, T., Cha, Y., Shin, B., Cha, B.: Survey and performance test of python-based libraries for parallel processing. In: The 9th International Conference on Smart Media and Applications, SMA 2020, pp. 154–157. Association for Computing Machinery, New York (2020). https://doi.org/10.1145/3426020.3426057
Lapenta, G.: Kinetic plasma simulation: particle in cell method
Lassner, C.: PyMP (2016). https://github.com/classner/pymp
Meneses, G.C.S.E.: Parallel programming tools in Python
Miranda, E., Stephany, S.: Comparison of high-performance computing approaches in the python environment for a five-point stencil test problem. In: Anais do XV Brazilian e-Science Workshop, pp. 33–40. SBC, Porto Alegre, RS, Brasil (2021). https://doi.org/10.5753/bresci.2021.15786, https://sol.sbc.org.br/index.php/bresci/article/view/15786
Pous, X.S.: Particle-in-cell algorithms for plasma simulations on heterogeneous architectures
Python: multiprocessing - process-based parallelism. https://docs.python.org/3/library/multiprocessing.html
Rao, V.R.: Here’s why you should use Python for scientific research (2018). https://developer.ibm.com/blogs/use-python-for-scientific-research/
Stańczak, D.: Implementation and performance analysis of particle-in-cell simulation software in Python (2017)
Top500: Top500 list. Top500 (2022). https://www.top500.org/
Zetcode: Zetcode. https://zetcode.com/python/multiprocessing/
Acknowledgments
This research was partially supported by a machine allocation on Kabré supercomputer at the Costa Rica National High Technology Center.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Blandino H., O., Meneses, E. (2022). A Comparative Evaluation of Parallel Programming Python Tools for Particle-in-Cell on Symmetric Multiprocessors. In: Navaux, P., Barrios H., C.J., Osthoff, C., Guerrero, G. (eds) High Performance Computing. CARLA 2022. Communications in Computer and Information Science, vol 1660. Springer, Cham. https://doi.org/10.1007/978-3-031-23821-5_1
Download citation
DOI: https://doi.org/10.1007/978-3-031-23821-5_1
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-23820-8
Online ISBN: 978-3-031-23821-5
eBook Packages: Computer ScienceComputer Science (R0)