Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

MPI for Python

This package provides Python bindings for the Message Passing Interface (MPI) standard. It is implemented on top of the MPI specification and exposes an API which grounds on the standard MPI-2 C++ bindings.

NOTE: This package includes MPICH binaries (an implementation of MPI) and does not require installing MPI before mpi4py. The MPI launcher (mpiexec) is also included and you can directly invoke it after installing this package. If Python’s bin folder is not in your PATH, you can also launch with python -m mpiexec …

Features

This package supports:

  • Convenient communication of any picklable Python object

    • point-to-point (send & receive)

    • collective (broadcast, scatter & gather, reductions)

  • Fast communication of Python object exposing the Python buffer interface (NumPy arrays, builtin bytes/string/array objects)

    • point-to-point (blocking/nonbloking/persistent send & receive)

    • collective (broadcast, block/vector scatter & gather, reductions)

  • Process groups and communication domains

    • Creation of new intra/inter communicators

    • Cartesian & graph topologies

  • Parallel input/output:

    • read & write

    • blocking/nonbloking & collective/noncollective

    • individual/shared file pointers & explicit offset

  • Dynamic process management

    • spawn & spawn multiple

    • accept/connect

    • name publishing & lookup

  • One-sided operations

    • remote memory access (put, get, accumulate)

    • passive target syncronization (start/complete & post/wait)

    • active target syncronization (lock & unlock)

Install

You can install mpi4py from its source distribution using pip:

$ python -m pip install mpi4py

You can also install the in-development version with:

$ python -m pip install git+https://github.com/mpi4py/mpi4py

or:

$ python -m pip install https://github.com/mpi4py/mpi4py/tarball/master

Installing from source requires compilers and a working MPI implementation. The mpicc compiler wrapper is looked for on the executable search path (PATH environment variable). Alternatively, you can set the MPICC environment variable to the full path or command corresponding to the MPI-aware C compiler.

The conda-forge community provides ready-to-use binary packages from an ever growing collection of software libraries built around the multi-platform conda package manager. Three MPI implementations are available on conda-forge: Open MPI (Linux and macOS), MPICH (Linux and macOS), and Microsoft MPI (Windows). You can install mpi4py and your preferred MPI implementation using conda:

* to use MPICH do::

$ conda install -c conda-forge mpi4py mpich

  • to use Open MPI do:

    $ conda install -c conda-forge mpi4py openmpi
  • to use Microsoft MPI do:

    $ conda install -c conda-forge mpi4py msmpi

MPICH and many of its derivatives are ABI-compatible. You can provide the package specification mpich=X.Y.*=external_* (where X and Y are the major and minor version numbers) to request the conda package manager to use system-provided MPICH (or derivative) libraries.

The openmpi package on conda-forge has built-in CUDA support, but it is disabled by default. To enable it, follow the instruction outlined during conda install. Additionally, UCX support is also available once the ucx package is installed.

On Fedora Linux systems (as well as RHEL and their derivatives using the EPEL software repository), you can install binary packages with the system package manager:

* using ``dnf`` and the ``mpich`` package::

$ sudo dnf install python3-mpi4py-mpich

  • using dnf and the openmpi package:

    $ sudo dnf install python3-mpi4py-openmpi

Please remember to load the correct MPI module for your chosen MPI implementation

  • for the mpich package do:

    $ module load mpi/mpich-$(arch)
    $ python -c "from mpi4py import MPI"
  • for the openmpi package do:

    $ module load mpi/openmpi-$(arch)
    $ python -c "from mpi4py import MPI"

On Ubuntu Linux and Debian Linux systems, binary packages are available for installation using the system package manager:

$ sudo apt install python3-mpi4py

Note that on Ubuntu/Debian systems, the mpi4py package uses Open MPI. To use MPICH, install the libmpich-dev and python3-dev packages (and any other required development tools). Afterwards, install mpi4py from sources using pip.

macOS users can install mpi4py using the Homebrew package manager:

$ brew install mpi4py

Note that the Homebrew mpi4py package uses Open MPI. Alternatively, install the mpich package and next install mpi4py from sources using pip.

Windows users can install mpi4py from binary wheels hosted on the Python Package Index (PyPI) using pip:

$ python -m pip install mpi4py

Windows wheels require a separate, system-wide installation of the Microsoft MPI runtime.

Citations

If MPI for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project.

Metadata

Release files for mpi4py-mpich 3.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for mpi4py-mpich 3.1.5
File
mpi4py_mpich-3.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
mpi4py_mpich-3.1.5-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
mpi4py_mpich-3.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
mpi4py_mpich-3.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details

Total release size: 20.8 MB

Release files / mpi4py_mpich-3.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mpi4py_mpich-3.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7a176b16b7c5630fe84f0f871cfd3428ca545cdffbbfae31157607e948973acf
BLAKE2b-256 checksum
How to use checksums
9ff2efbc656df5960031ff43e5aba0d80b1930362b04acd4a67ec30cb673e511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / mpi4py_mpich-3.1.5-cp311-cp311-macosx_11_0_arm64.whl

Download URL mpi4py_mpich-3.1.5-cp311-cp311-macosx_11_0_arm64.whl
Size 2.5 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
17242590c6786edc56cf996314620fae466e230081ea518a79a558b0334670bd
BLAKE2b-256 checksum
How to use checksums
e388e10e735360bb266d4d02735d9b64dfeabfd1c78b7db90316791e5215a245
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / mpi4py_mpich-3.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mpi4py_mpich-3.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
53568f445bd7a129cb56e052b1b8fa98b6ea2ce82ab17e3733fda1be52edbe0b
BLAKE2b-256 checksum
How to use checksums
1ae3942a8e3322e3f1a265409d4028843c2770864f9ee699ba692296aa743232
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / mpi4py_mpich-3.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mpi4py_mpich-3.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
28e5b85fccc6d59b1bb2939917685c88c35657cc907109cdc98cc6bcdab59549
BLAKE2b-256 checksum
How to use checksums
5269b7dfba2ba1b4a1de3ab024cd4e8a0897782572b70317c19d5a1d61592991
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

3.1.5 This release

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page