OMP4Py: A pure Python implementation of openMP
Python demonstrates lower performance in comparison to traditional high performance computing (HPC) languages such as C, C++, and Fortran. This performance gap is largely due to Python’s interpreted nature and the Global Interpreter Lock (GIL), which hampers multithreading efficiency. However, the latest version of Python includes the necessary changes to make the interpreter thread-safe, allowing Python code to run without the GIL. This important update will enable users to fully exploit multithreading parallelism in Python. In order to facilitate that task, this paper introduces OMP4Py, the first pure Python implementation of OpenMP. We demonstrate that it is possible to bring OpenMP’s familiar directive-based parallelization paradigm to Python, allowing developers to write parallel code with the same level of control and flexibility as in C, C++, or Fortran. The experimental evaluation shows that OMP4Py significantly impacts the performance of various types of applications, although the current threading limitations of Python’s interpreter (v3.13) reduce its effectiveness for numerical applications. • OMP4Py: First pure Python implementation of OpenMP for parallel programming. • Brings OpenMP’s directive-based parallelism to Python. • Combines with mpi4py for hybrid parallelism on clusters. • Supports broader applications than PyOMP, which is limited to numerical tasks.
Authors
- Juan C. Pichel (ORCID: https://orcid.org/0000-0001-9505-6493)
- César Piñeiro (ORCID: https://orcid.org/0000-0001-6490-7128)
Institutions
- Universidade de Santiago de Compostela (ES)
- Center for Research in Molecular Medicine and Chronic Diseases (ES)
Publication Details
- Journal
- Future Generation Computer Systems
- Published
- 2025-08-05
- DOI
- https://doi.org/10.1016/j.future.2025.108035
- Citations
- 1
- Primary Topic
- Distributed and Parallel Computing Systems
- Type
- article
- Field-Weighted Citation Impact
- 1.49
Funders
- Ministerio de Ciencia e Innovación
- Xunta de Galicia
- European Regional Development Fund