mpi4py


Namempi4py JSON
Version 4.0.1 PyPI version JSON
download
home_pageNone
SummaryPython bindings for MPI
upload_time2024-10-11 10:59:53
maintainerNone
docs_urlNone
authorLisandro Dalcin
requires_python>=3.6
licenseBSD-3-Clause
keywords scientific computing parallel computing message passing interface mpi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ==============
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.

.. _MPI: https://www.mpi-forum.org

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/nonblocking/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/nonblocking & 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 synchronization (start/complete & post/wait)
  + active target synchronization (lock & unlock)


Install
=======

Using **pip**
-------------

You can install the latest mpi4py release from its source distribution
at `PyPI <https://pypi.org/project/mpi4py/>`_ 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

.. note::

   Installing mpi4py from its source distribution (available at PyPI)
   or Git source code repository (available at GitHub) requires a C
   compiler and a working MPI implementation with development headers
   and libraries.

.. warning::

   ``pip`` keeps previously built wheel files on its cache for future
   reuse. If you want to reinstall the ``mpi4py`` package using a
   different or updated MPI implementation, you have to either first
   remove the cached wheel file with::

     $ python -m pip cache remove mpi4py

   or ask ``pip`` to disable the cache::

     $ python -m pip install --no-cache-dir mpi4py


Using **conda**
---------------

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. Four MPI implementations are
available on conda-forge: Open MPI (Linux and macOS), MPICH (Linux and
macOS), Intel MPI (Linux and Windows) and Microsoft MPI (Windows).
You can install mpi4py and your preferred MPI implementation using the
``conda`` package manager:

* 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 Intel MPI do::

  $ conda install -c conda-forge mpi4py impi_rt

* 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. Similarly, you can provide the package specification
``openmpi=X.Y.*=external_*`` to use system-provided Open MPI
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.

.. warning::

   Binary conda-forge packages are built with a focus on
   compatibility. The MPICH and Open MPI packages are build in a
   constrained environment with relatively dated OS images. Therefore,
   they may lack support for high-performance features like
   cross-memory attach (XPMEM/CMA). In production scenarios, it is
   recommended to use external (either custom-built or system-provided)
   MPI installations. See the relevant conda-forge documentation about
   `using external MPI libraries <cf-mpi-docs_>`_ .

.. _conda-forge: https://conda-forge.org/
.. _cf-mpi-docs: https://conda-forge.org/docs/user/tipsandtricks/#using-external-message-passing-interface-mpi-libraries


Linux
-----

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
-----

**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``.

.. _Homebrew: https://brew.sh/


Windows
-------

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

  $ python -m pip install mpi4py

The Windows wheels available on PyPI are specially crafted to work
with either the `Intel MPI <I_MPI_>`_ or the `Microsoft MPI <MSMPI_>`_
runtime, therefore requiring a separate installation of any one of
these packages.

.. _I_MPI: https://software.intel.com/intel-mpi-library
.. _MSMPI: https://learn.microsoft.com/message-passing-interface/microsoft-mpi

Intel MPI is under active development and supports recent version of
the MPI standard. Intel MPI can be installed with ``pip`` (see the
`impi-rt`_ package on PyPI), being therefore straightforward to get it
up and running within a Python environment. Intel MPI can also be
installed system-wide as part of the Intel HPC Toolkit for Windows or
via standalone online/offline installers.

.. _impi-rt: https://pypi.org/project/impi-rt/


Citation
========

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

* M. Rogowski, S. Aseeri, D. Keyes, and L. Dalcin,
  *mpi4py.futures: MPI-Based Asynchronous Task Execution for Python*,
  IEEE Transactions on Parallel and Distributed Systems, 34(2):611-622, 2023.
  https://doi.org/10.1109/TPDS.2022.3225481

* L. Dalcin and Y.-L. L. Fang,
  *mpi4py: Status Update After 12 Years of Development*,
  Computing in Science & Engineering, 23(4):47-54, 2021.
  https://doi.org/10.1109/MCSE.2021.3083216

* L. Dalcin, P. Kler, R. Paz, and A. Cosimo,
  *Parallel Distributed Computing using Python*,
  Advances in Water Resources, 34(9):1124-1139, 2011.
  https://doi.org/10.1016/j.advwatres.2011.04.013

* L. Dalcin, R. Paz, M. Storti, and J. D'Elia,
  *MPI for Python: performance improvements and MPI-2 extensions*,
  Journal of Parallel and Distributed Computing, 68(5):655-662, 2008.
  https://doi.org/10.1016/j.jpdc.2007.09.005

* L. Dalcin, R. Paz, and M. Storti,
  *MPI for Python*,
  Journal of Parallel and Distributed Computing, 65(9):1108-1115, 2005.
  https://doi.org/10.1016/j.jpdc.2005.03.010

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mpi4py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "scientific computing, parallel computing, message passing interface, MPI",
    "author": "Lisandro Dalcin",
    "author_email": "dalcinl@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/08/34/8499a92a387d24d0092c38089f8195f13c5c76f0f814126af3fe363e5636/mpi4py-4.0.1.tar.gz",
    "platform": null,
    "description": "==============\nMPI for Python\n==============\n\nThis package provides Python bindings for the *Message Passing\nInterface* (MPI_) standard. It is implemented on top of the MPI\nspecification and exposes an API which grounds on the standard MPI-2\nC++ bindings.\n\n.. _MPI: https://www.mpi-forum.org\n\nFeatures\n========\n\nThis package supports:\n\n* Convenient communication of any *picklable* Python object\n\n  + point-to-point (send & receive)\n  + collective (broadcast, scatter & gather, reductions)\n\n* Fast communication of Python object exposing the *Python buffer\n  interface* (NumPy arrays, builtin bytes/string/array objects)\n\n  + point-to-point (blocking/nonblocking/persistent send & receive)\n  + collective (broadcast, block/vector scatter & gather, reductions)\n\n* Process groups and communication domains\n\n  + Creation of new intra/inter communicators\n  + Cartesian & graph topologies\n\n* Parallel input/output:\n\n  + read & write\n  + blocking/nonblocking & collective/noncollective\n  + individual/shared file pointers & explicit offset\n\n* Dynamic process management\n\n  + spawn & spawn multiple\n  + accept/connect\n  + name publishing & lookup\n\n* One-sided operations\n\n  + remote memory access (put, get, accumulate)\n  + passive target synchronization (start/complete & post/wait)\n  + active target synchronization (lock & unlock)\n\n\nInstall\n=======\n\nUsing **pip**\n-------------\n\nYou can install the latest mpi4py release from its source distribution\nat `PyPI <https://pypi.org/project/mpi4py/>`_ using ``pip``::\n\n  $ python -m pip install mpi4py\n\nYou can also install the in-development version with::\n\n  $ python -m pip install git+https://github.com/mpi4py/mpi4py\n\nor::\n\n  $ python -m pip install https://github.com/mpi4py/mpi4py/tarball/master\n\n.. note::\n\n   Installing mpi4py from its source distribution (available at PyPI)\n   or Git source code repository (available at GitHub) requires a C\n   compiler and a working MPI implementation with development headers\n   and libraries.\n\n.. warning::\n\n   ``pip`` keeps previously built wheel files on its cache for future\n   reuse. If you want to reinstall the ``mpi4py`` package using a\n   different or updated MPI implementation, you have to either first\n   remove the cached wheel file with::\n\n     $ python -m pip cache remove mpi4py\n\n   or ask ``pip`` to disable the cache::\n\n     $ python -m pip install --no-cache-dir mpi4py\n\n\nUsing **conda**\n---------------\n\nThe `conda-forge`_ community provides ready-to-use binary packages\nfrom an ever growing collection of software libraries built around the\nmulti-platform *conda* package manager. Four MPI implementations are\navailable on conda-forge: Open MPI (Linux and macOS), MPICH (Linux and\nmacOS), Intel MPI (Linux and Windows) and Microsoft MPI (Windows).\nYou can install mpi4py and your preferred MPI implementation using the\n``conda`` package manager:\n\n* to use MPICH do::\n\n  $ conda install -c conda-forge mpi4py mpich\n\n* to use Open MPI do::\n\n  $ conda install -c conda-forge mpi4py openmpi\n\n* to use Intel MPI do::\n\n  $ conda install -c conda-forge mpi4py impi_rt\n\n* to use Microsoft MPI do::\n\n  $ conda install -c conda-forge mpi4py msmpi\n\nMPICH and many of its derivatives are ABI-compatible. You can provide\nthe package specification ``mpich=X.Y.*=external_*`` (where ``X`` and\n``Y`` are the major and minor version numbers) to request the conda\npackage manager to use system-provided MPICH (or derivative)\nlibraries. Similarly, you can provide the package specification\n``openmpi=X.Y.*=external_*`` to use system-provided Open MPI\nlibraries.\n\nThe ``openmpi`` package on conda-forge has built-in CUDA support, but\nit is disabled by default. To enable it, follow the instruction\noutlined during ``conda install``. Additionally, UCX support is also\navailable once the ``ucx`` package is installed.\n\n.. warning::\n\n   Binary conda-forge packages are built with a focus on\n   compatibility. The MPICH and Open MPI packages are build in a\n   constrained environment with relatively dated OS images. Therefore,\n   they may lack support for high-performance features like\n   cross-memory attach (XPMEM/CMA). In production scenarios, it is\n   recommended to use external (either custom-built or system-provided)\n   MPI installations. See the relevant conda-forge documentation about\n   `using external MPI libraries <cf-mpi-docs_>`_ .\n\n.. _conda-forge: https://conda-forge.org/\n.. _cf-mpi-docs: https://conda-forge.org/docs/user/tipsandtricks/#using-external-message-passing-interface-mpi-libraries\n\n\nLinux\n-----\n\nOn **Fedora Linux** systems (as well as **RHEL** and their derivatives\nusing the EPEL software repository), you can install binary packages\nwith the system package manager:\n\n* using ``dnf`` and the ``mpich`` package::\n\n  $ sudo dnf install python3-mpi4py-mpich\n\n* using ``dnf`` and the ``openmpi`` package::\n\n  $ sudo dnf install python3-mpi4py-openmpi\n\nPlease remember to load the correct MPI module for your chosen MPI\nimplementation:\n\n* for the ``mpich`` package do::\n\n  $ module load mpi/mpich-$(arch)\n  $ python -c \"from mpi4py import MPI\"\n\n* for the ``openmpi`` package do::\n\n  $ module load mpi/openmpi-$(arch)\n  $ python -c \"from mpi4py import MPI\"\n\nOn **Ubuntu Linux** and **Debian Linux** systems, binary packages are\navailable for installation using the system package manager::\n\n  $ sudo apt install python3-mpi4py\n\nNote that on Ubuntu/Debian systems, the mpi4py package uses Open\nMPI. To use MPICH, install the ``libmpich-dev`` and ``python3-dev``\npackages (and any other required development tools). Afterwards,\ninstall mpi4py from sources using ``pip``.\n\n\nmacOS\n-----\n\n**macOS** users can install mpi4py using the `Homebrew`_ package\nmanager::\n\n  $ brew install mpi4py\n\nNote that the Homebrew mpi4py package uses Open MPI. Alternatively,\ninstall the ``mpich`` package and next install mpi4py from sources\nusing ``pip``.\n\n.. _Homebrew: https://brew.sh/\n\n\nWindows\n-------\n\n**Windows** users can install mpi4py from binary wheels hosted on the\nPython Package Index (PyPI) using ``pip``::\n\n  $ python -m pip install mpi4py\n\nThe Windows wheels available on PyPI are specially crafted to work\nwith either the `Intel MPI <I_MPI_>`_ or the `Microsoft MPI <MSMPI_>`_\nruntime, therefore requiring a separate installation of any one of\nthese packages.\n\n.. _I_MPI: https://software.intel.com/intel-mpi-library\n.. _MSMPI: https://learn.microsoft.com/message-passing-interface/microsoft-mpi\n\nIntel MPI is under active development and supports recent version of\nthe MPI standard. Intel MPI can be installed with ``pip`` (see the\n`impi-rt`_ package on PyPI), being therefore straightforward to get it\nup and running within a Python environment. Intel MPI can also be\ninstalled system-wide as part of the Intel HPC Toolkit for Windows or\nvia standalone online/offline installers.\n\n.. _impi-rt: https://pypi.org/project/impi-rt/\n\n\nCitation\n========\n\nIf MPI for Python been significant to a project that leads to an\nacademic publication, please acknowledge that fact by citing the\nproject.\n\n* M. Rogowski, S. Aseeri, D. Keyes, and L. Dalcin,\n  *mpi4py.futures: MPI-Based Asynchronous Task Execution for Python*,\n  IEEE Transactions on Parallel and Distributed Systems, 34(2):611-622, 2023.\n  https://doi.org/10.1109/TPDS.2022.3225481\n\n* L. Dalcin and Y.-L. L. Fang,\n  *mpi4py: Status Update After 12 Years of Development*,\n  Computing in Science & Engineering, 23(4):47-54, 2021.\n  https://doi.org/10.1109/MCSE.2021.3083216\n\n* L. Dalcin, P. Kler, R. Paz, and A. Cosimo,\n  *Parallel Distributed Computing using Python*,\n  Advances in Water Resources, 34(9):1124-1139, 2011.\n  https://doi.org/10.1016/j.advwatres.2011.04.013\n\n* L. Dalcin, R. Paz, M. Storti, and J. D'Elia,\n  *MPI for Python: performance improvements and MPI-2 extensions*,\n  Journal of Parallel and Distributed Computing, 68(5):655-662, 2008.\n  https://doi.org/10.1016/j.jpdc.2007.09.005\n\n* L. Dalcin, R. Paz, and M. Storti,\n  *MPI for Python*,\n  Journal of Parallel and Distributed Computing, 65(9):1108-1115, 2005.\n  https://doi.org/10.1016/j.jpdc.2005.03.010\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Python bindings for MPI",
    "version": "4.0.1",
    "project_urls": {
        "Discussions": "https://github.com/mpi4py/mpi4py/discussions",
        "Documentation": "https://mpi4py.readthedocs.io/en/stable/",
        "Downloads": "https://github.com/mpi4py/mpi4py/releases",
        "Homepage": "https://mpi4py.github.io",
        "Issues": "https://github.com/mpi4py/mpi4py/issues",
        "Source": "https://github.com/mpi4py/mpi4py"
    },
    "split_keywords": [
        "scientific computing",
        " parallel computing",
        " message passing interface",
        " mpi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08348499a92a387d24d0092c38089f8195f13c5c76f0f814126af3fe363e5636",
                "md5": "443fd126aab32130d49eb80702abf561",
                "sha256": "f3174b245775d556f4fddb32519a2066ef0592edc810c5b5a59238f9a0a40c89"
            },
            "downloads": -1,
            "filename": "mpi4py-4.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "443fd126aab32130d49eb80702abf561",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 466179,
            "upload_time": "2024-10-11T10:59:53",
            "upload_time_iso_8601": "2024-10-11T10:59:53.425880Z",
            "url": "https://files.pythonhosted.org/packages/08/34/8499a92a387d24d0092c38089f8195f13c5c76f0f814126af3fe363e5636/mpi4py-4.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-11 10:59:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mpi4py",
    "github_project": "mpi4py",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "appveyor": true,
    "circle": true,
    "tox": true,
    "lcname": "mpi4py"
}
        
Elapsed time: 0.43371s