Performance Analysis of C and Python Parallel Implementations on a Multicore System Using Particle Simulation
Abu S. Asaduzzaman, Venkata S. P. T. Telikepalli, Md Raihan Uddin · 2024
Multicore architecture has become the dominant trend in modern computer design to achieve high performance. To take advantage of multicore systems and develop well-performing applications, various multithreading libraries and application programming interfaces (APIs) are introduced. However, it is often challenging to decide which programming language should provide the best performance for a given set of architecture and applications. In this work, we investigate the performance of C language with Open Multi-Processing (OpenMP) and Message Passing Interface (MPI) and Python language with multithreading and MPI using particle simulation application. We simulate 1K, 5K, and 10K particles on a three-core system with CentOS operating system. Experimental results show that OpenMP C code provides consistent increase in speedup for up to 12 threads. Python may be easy for beginners to learn, but the results suggest that C clearly outperforms Python for particle simulation.