{"id":27208,"library":"openmpi","title":"Open MPI","description":"Open MPI is a high performance implementation of the Message Passing Interface (MPI) standard, used for parallel computing. The Python package 'openmpi' is a wrapper that provides MPI bindings for Python. Current version is 5.0.10. Release cadence is irregular, following upstream Open MPI releases.","status":"active","version":"5.0.10","language":"python","source_language":"en","source_url":"https://github.com/open-mpi/ompi","tags":["mpi","parallel-computing","hpc","openmpi","mpi4py"],"install":[{"cmd":"pip install openmpi","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Open MPI Python interface often relies on mpi4py for Python bindings; openmpi package may be a meta-package or wrapper.","package":"mpi4py","optional":false}],"imports":[{"note":"Direct import of 'openmpi' is incorrect; the actual MPI Python API is provided by mpi4py.","wrong":"import openmpi","symbol":"MPI","correct":"from mpi4py import MPI"}],"quickstart":{"code":"from mpi4py import MPI\n\ncomm = MPI.COMM_WORLD\nrank = comm.Get_rank()\nsize = comm.Get_size()\n\nprint(f\"Hello from rank {rank} of {size}\")\n\n# Example: send and receive\nif rank == 0:\n    data = {'a': 7, 'b': 3.14}\n    comm.send(data, dest=1)\nelif rank == 1:\n    data = comm.recv(source=0)\n    print(f\"Rank 1 received: {data}\")","lang":"python","description":"Initialize MPI, get rank and size, and perform a simple send/receive."},"warnings":[{"fix":"Use mpi4py instead. Install via: pip install mpi4py","message":"The 'openmpi' PyPI package may not provide Python bindings directly; actual MPI programming in Python typically uses 'mpi4py'. Ensure mpi4py is installed and that the underlying Open MPI library is available on your system.","severity":"gotcha","affected_versions":"all"},{"fix":"Review application code for any non-standard MPI usage; consult Open MPI 5 migration guide.","message":"Open MPI 5.x is not backward compatible with Open MPI 4.x custom MPI extensions. User-defined functions that rely on internal MPI hooks may break.","severity":"breaking","affected_versions":"5.x"},{"fix":"Use 'mpirun' or switch to 'prrte' launcher if needed.","message":"The 'ompi' command-line tool has been deprecated in favor of 'prrte' for runtime launch. Using 'mpirun' is still supported but may emit warnings.","severity":"deprecated","affected_versions":"5.x"},{"fix":"Install system-level Open MPI via package manager (e.g., apt, brew) before using mpi4py.","message":"Open MPI requires a compatible Fortran compiler at build time; if you compile from source, you may need to install gfortran. Pre-built Python wheels may not be available.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install mpi4py' and ensure the system has an MPI implementation (e.g., Open MPI).","cause":"mpi4py is not installed; openmpi package alone does not provide Python bindings.","error":"ImportError: No module named mpi4py"},{"fix":"Install Open MPI using your package manager: 'sudo apt install libopenmpi-dev' (Ubuntu) or 'brew install open-mpi' (macOS).","cause":"The underlying MPI library (e.g., Open MPI) is not installed on the system or not in the library path.","error":"OSError: libmpi.so: cannot open shared object file: No such file or directory"},{"fix":"Check system limits (ulimit -u), ensure PRTE daemon is running, or use '--oversubscribe' flag with mpirun.","cause":"Insufficient resources or misconfigured process manager (ORTE/PRRTE).","error":"MPI_Comm_spawn failed with error code 12"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}