{"library":"mpi4py","title":"MPI for Python","description":"mpi4py provides Python bindings for the Message Passing Interface (MPI) standard, enabling parallel programming with Python. It allows Python applications to leverage high-performance distributed memory architectures. The current version is 4.1.1, and it typically sees a few minor and patch releases per year, with major feature updates (like MPI standard support) in new minor versions.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install mpi4py"],"cli":null},"imports":["from mpi4py import MPI"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from mpi4py import MPI\nimport os\n\n# Get the default communicator (all processes)\ncomm = MPI.COMM_WORLD\n\n# Get the rank of the current process\nrank = comm.Get_rank()\n\n# Get the total number of processes\nsize = comm.Get_size()\n\n# Each process prints its rank and size\nprint(f\"Hello from process {rank} of {size} on host {os.uname().nodename}\")\n\n# Use a barrier to ensure all processes reach this point before exiting\ncomm.Barrier()","lang":"python","description":"This 'Hello, World!' example demonstrates how to initialize MPI, get the rank of the current process, and the total number of processes in the communicator. Save it as `hello.py` and run with `mpirun -np 4 python hello.py` for 4 processes.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"4.1.1","pypi_latest":"4.1.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":50,"avg_install_s":1.6,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mpi4py","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mpi4py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"23M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mpi4py","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mpi4py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"25M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mpi4py","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mpi4py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"17M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mpi4py","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mpi4py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"17M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mpi4py","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mpi4py","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.8,"import_time_s":null,"mem_mb":null,"disk_size":"23M"}]}}