Git Product home page Git Product logo

mpi4py's Introduction

MPI for Python

https://github.com/mpi4py/mpi4py/workflows/ci/badge.svg?branch=master https://readthedocs.org/projects/mpi4py/badge/?version=latest https://dev.azure.com/mpi4py/mpi4py/_apis/build/status/ci?branchName=master&label=azure https://ci.appveyor.com/api/projects/status/whh5xovp217h0f7n?svg=true https://circleci.com/gh/mpi4py/mpi4py.svg?style=shield
pypy mpi4py conda-forge anaconda
homebrew fedora ubuntu debian archlinux

Overview

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.

Prerequisites

  • Python 3.6 or above, or PyPy 7.2 or above.
  • An MPI implementation like MPICH or Open MPI built with shared/dynamic libraries.

Documentation

Support

Testsuite

The testsuite is run periodically on

Citation

  • 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

mpi4py's People

Contributors

basnijholt avatar bdice avatar bhpayne avatar bosilca avatar dalcinl avatar dependabot[bot] avatar dmitry-kabanov avatar drew-parsons avatar ewouth avatar ftherrien avatar ggouaillardet avatar inwaves avatar lebedov avatar lefarov avatar leofang avatar matthiasdiener avatar maxhgerlach avatar mrogowski avatar paulromano avatar roblatham00 avatar saosudo avatar socob avatar tomspur avatar zyv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpi4py's Issues

Question related to NCCL + MPI

Does using comm = MPI.COMM_WORLD affect pytorch in any way? Pytorch can be built on NCCL or MPI backends but supports only NCCL by default. I have seen situations where mpi4py works with pytorch seamlessly, but this is my question: Does the NCCL background of pytorch affect the use of mpi4py in any way? I'd like to know what happens under the hood when it works with NCCL built pytorch.

test_datatype.TestDatatype failure on Fedora Rawhide ppc64le

+ mpiexec -np 1 python3 test/runtests.py -v --no-builddir
/builddir/build/BUILD/mpi4py-3.1.1/test/runtests.py:76: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.util import get_platform
[[email protected]] Python 3.10 (/usr/bin/python3)
[[email protected]] MPI 3.1 (Open MPI 4.1.1)
[[email protected]] mpi4py 3.1.1 (/builddir/build/BUILDROOT/mpi4py-3.1.1-1.fc36.ppc64le/usr/lib64/python3.10/site-packages/openmpi/mpi4py)
...
======================================================================
ERROR: testCreateF90ComplexDouble (test_datatype.TestDatatype)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_datatype.py", line 324, in testCreateF90ComplexDouble
    self.check_datatype(None, factory, *args)
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_datatype.py", line 144, in check_datatype
    newtype = factory(*args)
  File "mpi4py/MPI/Datatype.pyx", line 352, in mpi4py.MPI.Datatype.Create_f90_complex
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testCreateF90RealDouble (test_datatype.TestDatatype)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_datatype.py", line 306, in testCreateF90RealDouble
    self.check_datatype(None, factory, *args)
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_datatype.py", line 144, in check_datatype
    newtype = factory(*args)
  File "mpi4py/MPI/Datatype.pyx", line 343, in mpi4py.MPI.Datatype.Create_f90_real
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
----------------------------------------------------------------------
Ran 1385 tests in 73.838s
FAILED (errors=2, skipped=191)

[DOC] Document more env vars?

We should make a distinction between env vars used at build time and those used at runtime. Runtime env vars include:

  • MPI4PY_FUTURES_MAX_WORKERS (now documented!)
  • MPI4PY_FUTURES_SERVICE
  • MPI4PY_FUTURES_SERVER_HOST
  • MPI4PY_FUTURES_SERVER_BIND
  • MPI4PY_FUTURES_SERVER_PORT

and build time env vars include:

Some of them are not mpi4py's env vars, but maybe worth mentioning?

Importing the C API fails on Windows

I am trying to build a C++ Python extension (with pybind11) that uses MPI and mpi4py on Windows. I am working in a conda environment and I installed mpi4py as follows:

conda install mpi4py -c conda-forge --yes

The following:

// import the mpi4py API
if (import_mpi4py() < 0) {
  throw std::runtime_error("Could not load mpi4py API.");
}

throws the exception with traceback:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\IEUser\VeloxChemMP\build_dbg_14.27\lib\python3.8\site-packages\veloxchem\__init__.py", line 2, in <module>
    from .veloxchemlib import AtomBasis
ImportError: Could not load mpi4py API.

Running mpiexec -n 4 python -c “from mpi4py import MPI; comm = MPI.COMM_WORLD; print(comm.Get_rank())” works as expected. I am not sure whether this is a bug or some silly mistake I am making.

This issue was migrated from moved from BitBucket #177

demo/compute-pi/cpi-rma.py fails with MPI_ERR_WIN: invalid window

I am using mpi4py on MacOS (Apple Silicon) with Open-MPI 4.1.1_2 from Homebrew (/opt/homebrew/Cellar/open-mpi/4.1.1_2).

I do not think the OSC warning below is relevant, because I am running a single process.

% mpiexec -n 1 python3 -m mpi4py demo/compute-pi/cpi-rma.py
--------------------------------------------------------------------------
The OSC pt2pt component does not support MPI_THREAD_MULTIPLE in this release.
Workarounds are to run on a single node, or to use a system with an RDMA
capable network such as Infiniband.
--------------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Cellar/[email protected]/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/homebrew/lib/python3.9/site-packages/mpi4py/__main__.py", line 7, in <module>
    main()
  File "/opt/homebrew/lib/python3.9/site-packages/mpi4py/run.py", line 198, in main
    run_command_line(args)
  File "/opt/homebrew/lib/python3.9/site-packages/mpi4py/run.py", line 47, in run_command_line
    run_path(sys.argv[0], run_name='__main__')
  File "/opt/homebrew/Cellar/[email protected]/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/opt/homebrew/Cellar/[email protected]/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/opt/homebrew/Cellar/[email protected]/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "demo/compute-pi/cpi-rma.py", line 44, in <module>
    win_n  = MPI.Win.Create(n,  comm=MPI.COMM_WORLD)
  File "mpi4py/MPI/Win.pyx", line 77, in mpi4py.MPI.Win.Create
mpi4py.MPI.Exception: MPI_ERR_WIN: invalid window
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------

Status of cupy support

I tried to run the test case

# To run this script with N MPI processes, do
# mpiexec -n N python this_script.py

import cupy
from mpi4py import MPI

comm = MPI.COMM_WORLD
size = comm.Get_size()

# Allreduce
sendbuf = cupy.arange(10, dtype='i')
recvbuf = cupy.empty_like(sendbuf)
comm.Allreduce(sendbuf, recvbuf)
assert cupy.allclose(recvbuf, sendbuf*size)

but I get a segfault error. I am running version 3.1.1 installed using pip. 
Is it necessary to compile from scratch? Are there special flags? 

test_io.TestIOSelf failures on Fedora Rawhide i686

Seeing this on Fedora Rawhide i686:

+ mpiexec -np 1 python3 test/runtests.py -v --no-builddir
/builddir/build/BUILD/mpi4py-3.1.1/test/runtests.py:76: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.util import get_platform
[[email protected]] Python 3.10 (/usr/bin/python3)
[[email protected]] MPI 3.1 (Open MPI 4.1.1)
[[email protected]] mpi4py 3.1.1 (/builddir/build/BUILDROOT/mpi4py-3.1.1-1.fc36.i386/usr/lib/python3.10/site-packages/openmpi/mpi4py)
--------------------------------------------------------------------------
The OSC pt2pt component does not support MPI_THREAD_MULTIPLE in this release.
Workarounds are to run on a single node, or to use a system with an RDMA
capable network such as Infiniband.
--------------------------------------------------------------------------
...
======================================================================
ERROR: testIReadIWrite (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 124, in testIReadIWrite
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWriteAll (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 302, in testIReadIWriteAll
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWriteAt (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 75, in testIReadIWriteAt
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWriteAtAll (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 227, in testIReadIWriteAtAll
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWriteShared (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 176, in testIReadIWriteShared
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWrite (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 97, in testReadWrite
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAll (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 276, in testReadWriteAll
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAllBeginEnd (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 329, in testReadWriteAllBeginEnd
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAt (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 53, in testReadWriteAt
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAtAll (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 203, in testReadWriteAtAll
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAtAllBeginEnd (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 252, in testReadWriteAtAllBeginEnd
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteOrdered (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 355, in testReadWriteOrdered
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteOrderedBeginEnd (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 379, in testReadWriteOrderedBeginEnd
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteShared (test_io.TestIOSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 151, in testReadWriteShared
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWrite (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 124, in testIReadIWrite
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWriteAll (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 302, in testIReadIWriteAll
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWriteAt (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 75, in testIReadIWriteAt
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWriteAtAll (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 227, in testIReadIWriteAtAll
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testIReadIWriteShared (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 176, in testIReadIWriteShared
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWrite (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 97, in testReadWrite
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAll (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 276, in testReadWriteAll
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAllBeginEnd (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 329, in testReadWriteAllBeginEnd
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAt (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 53, in testReadWriteAt
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAtAll (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 203, in testReadWriteAtAll
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteAtAllBeginEnd (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 252, in testReadWriteAtAllBeginEnd
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteOrdered (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 355, in testReadWriteOrdered
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteOrderedBeginEnd (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 379, in testReadWriteOrderedBeginEnd
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
ERROR: testReadWriteShared (test_io.TestIOWorld)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_io.py", line 151, in testReadWriteShared
    fh.Set_view(0, etype)
  File "mpi4py/MPI/File.pyx", line 215, in mpi4py.MPI.File.Set_view
mpi4py.MPI.Exception: MPI_ERR_ARG: invalid argument of some other kind
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='q')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 20 != 24
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='Q')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 20 != 24
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='d')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 20 != 24
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='g')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 28 != 36
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='D')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 36 != 40
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='G')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 52 != 60
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='i8')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 20 != 24
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='u8')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 20 != 24
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='f8')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 20 != 24
----------------------------------------------------------------------
Ran 1385 tests in 41.098s
FAILED (failures=9, errors=28, skipped=191)

mpi4py.futures.MPIPoolExecutor : add "initializer" argument?

Hi,

I'm trying to adapt my python multiprocessing code to use mpi4py, and it would be convenient if the MPIPoolExecutor had initializer and initializer_args arguments, like multiprocessing.pool.Pool, to allow global initialization steps. (In my case, I just realized that all my logging messages were probably not appearing because the logging module in the workers was not initialized.) I don't think there is an obvious way to achieve this same result by, say, calling a pool.map(initializer, [init_args]*pool_size), because you'd like it to run exactly once per worker.

https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool

Thanks for your work on mpi4py -- I've just begun using it but it looks really great! I was (more-or-less) able to convert my single-node multiprocessing code into a multi-node MPI app with only a small wrapper script. That's pretty impressive (on your part!).

mpi4py.futures.MPIPoolExecutor hangs at comm.Disconnect() inside client_close(comm)

Background information

mpi4py 3.0.3
PyPy 7.3.3 (Python 2.7.18)
Intel MPI Version 2019 Update 8 Build 20200624
GNU/Linux 3.10.0-1160.11.1.el7.x86_64
slurm 20.02.5

Details of the problem

Sample code

from mpi4py import MPI
import mpi4py.futures as mp
import sys

def write(x):
    sys.stdout.write(x)
    sys.stdout.flush()

def fun(args):
    rank = MPI.COMM_WORLD.Get_rank()
    return rank
    
if __name__ == '__main__':
    size = MPI.COMM_WORLD.Get_size()
    rank = MPI.COMM_WORLD.Get_rank()
    for i in range(size):
        MPI.COMM_WORLD.Barrier()
        if rank == i:
            write('Parent %d\n' % rank)
            with mp.MPIPoolExecutor(2) as pool:
                write(', '.join(map(str, pool.map(fun, range(2)))) + '\n')
shell$ srun -N 16 --ntasks-per-node 2 --pty /bin/bash -l
shell$ mpirun -ppn 1 ./test_mpi.py
Parent 0
0, 1

It hangs here. When I traced the function calls, I found the problem at futures/_lib.py -> def client_close(comm): -> comm.Disconnect()
Similarly, when the with statement is replaced with an assignment statement and pool.shutdown() is called after the for loop, all the processes print their messages correctly but the program still hangs at comm.Disconnect().
A similar C code version of this code does not produce this problem.

Gatherv problems conversion error and receive buffer size segfaults

 if mpicomm.rank == 0:
        F = np.empty(sum(sendcounts), dtype=float)
    else:
        F = None

    mpicomm.comm.Gatherv(sendbuf=local_F, recvbuf=(F, sendcounts), root=0)

The data that is exchanged from 1 proc (in case of 128 processors) is roughly 34 MB.

  1. Gatherv problem in 1 processor case:
OverflowError: value too large to convert to int
Traceback (most recent call last):
  File "/data/backup/ARR1905/alsalihi/venv_AARR1905/Test_spacepartitioning/Case20/SMARTA/O2-V2-Huge/SMARTA.py", line 120, in <module>
    F = view_factors(mpicomm, universe)
  File "/data/backup/ARR1905/alsalihi/venv_AARR1905/Test_spacepartitioning/Case20/SMARTA/O2-V2-Huge/rarfunc.py", line 84, in view_factors
    mpicomm.comm.Gatherv(sendbuf=local_F, recvbuf=(F, sendcounts), root=0)
  File "mpi4py/MPI/Comm.pyx", line 601, in mpi4py.MPI.Comm.Gatherv
  File "mpi4py/MPI/msgbuffer.pxi", line 506, in mpi4py.MPI._p_msg_cco.for_gather
  File "mpi4py/MPI/msgbuffer.pxi", line 456, in mpi4py.MPI._p_msg_cco.for_cco_recv
  File "mpi4py/MPI/msgbuffer.pxi", line 300, in mpi4py.MPI.message_vector
  File "mpi4py/MPI/asarray.pxi", line 22, in mpi4py.MPI.chkarray
  File "mpi4py/MPI/asarray.pxi", line 15, in mpi4py.MPI.getarray
OverflowError: value too large to convert to int
  1. Similar problem in parallel:
[node13.fk.private.vki.eu:20373] Read -1, expected 270734080, errno = 14
[node13:20373:0:20373] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x7f4771e93820)
==== backtrace ====
    0  /lib64/libucs.so.0(+0x1b25f) [0x7f53d7ac025f]
    1  /lib64/libucs.so.0(+0x1b42a) [0x7f53d7ac042a]
    2  /lib64/libc.so.6(+0x15f396) [0x7f53fda7e396]
    3  /software/alternate/fk/openmpi/4.0.2/lib/libopen-pal.so.40(opal_convertor_unpack+0x85) [0x7f53dda64895]
    4  /software/alternate/fk/openmpi/4.0.2/lib/openmpi/mca_pml_ob1.so(mca_pml_ob1_recv_request_progress_frag+0x1a7) [0x7f53d7fe4ed7]
    5  /software/alternate/fk/openmpi/4.0.2/lib/openmpi/mca_btl_vader.so(mca_btl_vader_poll_handle_frag+0x7f) [0x7f53d7ff6a7f]
    6  /software/alternate/fk/openmpi/4.0.2/lib/openmpi/mca_btl_vader.so(+0x4d77) [0x7f53d7ff6d77]
    7  /software/alternate/fk/openmpi/4.0.2/lib/libopen-pal.so.40(opal_progress+0x2c) [0x7f53dda53f3c]
    8  /software/alternate/fk/openmpi/4.0.2/lib/libopen-pal.so.40(ompi_sync_wait_mt+0xb5) [0x7f53dda5a585]
    9  /software/alternate/fk/openmpi/4.0.2/lib/openmpi/mca_pml_ob1.so(mca_pml_ob1_recv+0x803) [0x7f53d7fd7ba3]
   10  /software/alternate/fk/openmpi/4.0.2/lib/openmpi/mca_coll_basic.so(mca_coll_basic_gatherv_intra+0x18a) [0x7f53d7fc383a]
   11  /software/alternate/fk/openmpi/4.0.2/lib/libmpi.so.40(MPI_Gatherv+0xf0) [0x7f53ddc54140]
   12  /data/backup/ARR1905/alsalihi/venv_AARR1905/lib64/python3.7/site-packages/mpi4py/MPI.cpython-37m-x86_64-linux-gnu.so(+0x136939) [0x7f53dde38939]
   13  /lib64/libpython3.7m.so.1.0(_PyMethodDef_RawFastCallKeywords+0x334) [0x7f53fd6e0154]
   14  /lib64/libpython3.7m.so.1.0(_PyCFunction_FastCallKeywords+0x23) [0x7f53fd6e01b3]
   15  /lib64/libpython3.7m.so.1.0(+0x140473) [0x7f53fd712473]
   16  /lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x192e) [0x7f53fd74913e]
   17  /lib64/libpython3.7m.so.1.0(_PyEval_EvalCodeWithName+0x2f0) [0x7f53fd6ff7e0]
   18  /lib64/libpython3.7m.so.1.0(_PyFunction_FastCallKeywords+0x2a2) [0x7f53fd700822]
   19  /lib64/libpython3.7m.so.1.0(+0x14035f) [0x7f53fd71235f]
   20  /lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xb5a) [0x7f53fd74836a]
   21  /lib64/libpython3.7m.so.1.0(_PyEval_EvalCodeWithName+0x2f0) [0x7f53fd6ff7e0]
   22  /lib64/libpython3.7m.so.1.0(PyEval_EvalCodeEx+0x39) [0x7f53fd700579]
   23  /lib64/libpython3.7m.so.1.0(PyEval_EvalCode+0x1b) [0x7f53fd78fccb]
   24  /lib64/libpython3.7m.so.1.0(+0x1ffc63) [0x7f53fd7d1c63]
   25  /lib64/libpython3.7m.so.1.0(PyRun_FileExFlags+0x97) [0x7f53fd7d21d7]
   26  /lib64/libpython3.7m.so.1.0(PyRun_SimpleFileExFlags+0x19a) [0x7f53fd7d893a]
   27  /lib64/libpython3.7m.so.1.0(+0x208701) [0x7f53fd7da701]
   28  /lib64/libpython3.7m.so.1.0(_Py_UnixMain+0x3c) [0x7f53fd7da8ac]
   29  /lib64/libc.so.6(__libc_start_main+0xf3) [0x7f53fd942f43]
   30  python3(_start+0x2e) [0x557f8aedd08e]
===================

OverflowError: integer 2176051861 does not fit in 'int'

I'm trying to scatter data across 25 processors using:
attributes=comm.scatter(attributes,root=0)

But I always run into the following problem:

Traceback (most recent call last):
  File "PBGENA.py", line 99, in <module>
    attributes=comm.scatter(attributes,root=0)
  File "mpi4py/MPI/Comm.pyx", line 1267, in mpi4py.MPI.Comm.scatter
  File "mpi4py/MPI/msgpickle.pxi", line 730, in mpi4py.MPI.PyMPI_scatter
  File "mpi4py/MPI/msgpickle.pxi", line 125, in mpi4py.MPI.Pickle.dumpv
  File "mpi4py/MPI/msgbuffer.pxi", line 44, in mpi4py.MPI.downcast
OverflowError: integer 2176051861 does not fit in 'int'

I know for a fact that my data has no integer >=2176051861. The data I'm trying to scatter is a dictionary containing data of type <class 'scipy.sparse.csr.csr_matrix'>

Any help is greatly appreciated.

`mpi4py` and timeouts

I could not find anything in the docs or old api ref for collective calls like Barrier to specify a timeout or any other way to recover from a deadlock and handle that gracefully on all involved processes. Is there any such functionality in mpi4py, or the MPI spec, or any recommended way of achieving this myself?

Is there some sort of graceful MPI_Abort that just interrupts certain MPI processes, raises an exception, but does not force kill them?

The most graceful way of achieving this if nothing like it exists that I could think of is to have a "sentinel thread" running on each process that listens for MPI messages with a certain tag meant for interrupting each other. Processes who've been asked to time out could then start timers and if they don't return from a collective call before that they ping the sentinels of other processes so that these sentinels can raise some sort of TimeoutError on their respective processes. Key to this approach would be what happens when Python exceptions are raised on a thread when processes are in an MPI call.

Thoughts before I reinvent the wheel again? ;)

Allowing for parallel installation of multiple MPI implementations

At https://github.com/mpi4py/mpi4py/pull/131/files#r742700593 we discussed whether it would be useful to allow mpi4py to provide for parallel MPI implementations at the same time. This could serve two purposes. First it could give users easier choice of which implementation they want. Secondly it could facilitate testing against multiple implementations.

One part of the challenge is that the python extension MPI.cpython-39-x86_64-linux-gnu.so links to one implementation but is not identified by file name which implementation it uses one.

In principle it would be easy enough to set up an implementation specific installation. Just move everything in mpi4py/* to an implementation subdir, mpi4py/openmpi/* or mpi4py/mpich/* (or mpi4py/intelmpi/*, etc).

Then toplevel mpi4py/__init__.py could be written to pull in a default implementation, such that import mpi4py and from mpi4py import MPI continue to work without users noticing.

Choice of implementation could be made with an environment variable, e.g. MPI4PY_MPI_IMPLEMENTATION=mpich python3 -c "from mpi4py import MPI" loads the mpich implementation. Alternatively the specific implementation could be accessed directly, from mpi4py.mpich import MPI or similar.

I've set up an analogue of this kind of installation with the Debian/Ubuntu packaging of h5py, which enables parallel installation of both the serial and mpi builds. Toplevel __init__.py loads the h5py serial build by default if running as a serial process, or the mpi build if an mpi environment is detected. cf. https://salsa.debian.org/science-team/h5py/-/blob/master/debian/wrapper_module/h5py/__init__.py

This kind of installation could address some of the concerns @dalcinl raised at https://github.com/mpi4py/mpi4py/pull/131/files#r742720963 about needing root access to change the alternative preferred MPI implementation on Debian systems. The system administrator could have both implementations installed, then the user is free to select the non-default build with mpi4py. I guess it could also be useful for local user pip installations too, if a user want access to multiple MPI implementations with their own installation.

mpi4py error during getting results (in pare with SLURM)

ERROR:
Traceback (most recent call last):
File "/opt/software/anaconda/3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/opt/software/anaconda/3/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/vasko/.local/lib/python3.6/site-packages/mpi4py/futures/main.py", line 72, in
main()
File "/home/vasko/.local/lib/python3.6/site-packages/mpi4py/futures/main.py", line 60, in main
run_command_line()
File "/home/vasko/.local/lib/python3.6/site-packages/mpi4py/run.py", line 47, in run_command_line
run_path(sys.argv[0], run_name='main')
File "/opt/software/anaconda/3/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/opt/software/anaconda/3/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/opt/software/anaconda/3/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "cali_send_2.py", line 137, in
globals()[sys.argv[1]](sys.argv[2], sys.argv[3])
File "cali_send_2.py", line 94, in solve_on_cali
sols = list(executor.map(solve_matrix, repeat(inputs), range(len(wls)), wls))
File "/home/vasko/.local/lib/python3.6/site-packages/mpi4py/futures/pool.py", line 207, in result_iterator
yield futures.pop().result()
File "/opt/software/anaconda/3/lib/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/opt/software/anaconda/3/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 5: invalid start byte

ENV
CentOS release 6.5 (Final)
Python 3.6 anaconda
mpiexec (OpenRTE) 1.8.2
mpi4py 3.0.3

Piece of Code:

inputs = [der_mats, ref_ind_yee_grid, n_xy_sq, param_sweep_on, i_m, inv_eps, sol_params]
with MPIPoolExecutor(max_workers=int(nodes)) as executor:
   sols = list(executor.map(solve_matrix, repeat(inputs), range(len(wls)), wls))
   executor.shutdown(wait=True)  # wait for all complete
   zipobj = ZipFile(zp_fl_nm, 'w')

   for sol in sols:
      w, v, solnum, vq = sol
      print(w[0], solnum) # this line will shows if data have duplicates.
      w.tofile(f"w_sol_{solnum}.npy")
      v.tofile(f"v_sol_{solnum}.npy")
      vq.tofile(f"vq_sol_{solnum}.npy")
      zipobj.write(f"w_sol_{solnum}.npy")
      zipobj.write(f"v_sol_{solnum}.npy")
      zipobj.write(f"vq_sol_{solnum}.npy")
      os.remove(f"w_sol_{solnum}.npy")
      os.remove(f"v_sol_{solnum}.npy")
      os.remove(f"vq_sol_{solnum}.npy")

Call of method I do with sending command like this:
f'srun --mpi=pmi2 -n ${{SLURM_NTASKS}} python -m mpi4py.futures cali_send_2.py solve_on_cali \"\"{name}\"\" {num_nodes}'

Sometimes this error not appear if I use another range for wls with (wls = np.arange(0.4e-6, 1.8e-6, 0.01e-6)) it crush with this error or return duplicates of some solutions if step 0.1e-6.
If I use this range (wls = np.arange(0.55e-6, 1.55e-6, 0.01e-6)) with any step 0.1e-6 or 0.001e-6 it's NOT crush with mentioned error and returns good results without duplicates.

Could someone please explain me what is the origin of this error?
My suspicion is pointing on float numbers like 1.699999999999999999999e-6

Documentation broken or source reference missing?

None of the class links in the doc, such as MPI.Comm work (but intersphinx links such as pickle do work).

On top of that there also doesn't seem to be a way to view the reference docs or source code docs. Is the doc build broken?

cuda tests fail when CUDA is available but not configured

I'm testing the build of the new release 3.1.1.

All tests accessing cuda are failing. This is not entirely surprising in itself. My system has nvidia drivers available and has a switchable nvidia card accessible via bumblebee (primusrun). But I have not specifically configured my system to execute CUDA. So it's not surprising that CUDA_ERROR_NO_DEVICE is found. For me the nvidia card that I have at hand is for experimentation, not for routine operation. The main video card is intel.

What's the best way to handle this situation? How can a non-CUDA build be enforced when CUDA is otherwise "available".

An example test log is:

ERROR: testAllgather (test_cco_buf.TestCCOBufInplaceSelf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/projects/python/build/mpi4py/test/test_cco_buf.py", line 382, in testAllgather
    buf = array(-1, typecode, (size, count))
  File "/projects/python/build/mpi4py/test/arrayimpl.py", line 459, in __init__
    self.array = numba.cuda.device_array(shape, typecode)
  File "/usr/lib/python3/dist-packages/numba/cuda/cudadrv/devices.py", line 223, in _require_cuda_context
    with _runtime.ensure_context():
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/usr/lib/python3/dist-packages/numba/cuda/cudadrv/devices.py", line 121, in ensure_context
    with driver.get_active_context():
  File "/usr/lib/python3/dist-packages/numba/cuda/cudadrv/driver.py", line 393, in __enter__
    driver.cuCtxGetCurrent(byref(hctx))
  File "/usr/lib/python3/dist-packages/numba/cuda/cudadrv/driver.py", line 280, in __getattr__
    self.initialize()
  File "/usr/lib/python3/dist-packages/numba/cuda/cudadrv/driver.py", line 240, in initialize
    raise CudaSupportError("Error at driver init: \n%s:" % e)
numba.cuda.cudadrv.error.CudaSupportError: Error at driver init:
[100] Call to cuInit results in CUDA_ERROR_NO_DEVICE:
-------------------- >> begin captured logging << --------------------
numba.cuda.cudadrv.driver: INFO: init
numba.cuda.cudadrv.driver: DEBUG: call driver api: cuInit
numba.cuda.cudadrv.driver: ERROR: Call to cuInit results in CUDA_ERROR_NO_DEVICE
--------------------- >> end captured logging << ---------------------

Memory limit for communicating python objects

It seems that if objects get larger than 2GB, they trigger an error: SystemError: Negative size passed to PyBytes_FromStringAndSize

The issue is quite old, and is probably best explained in this post: https://stackoverflow.com/questions/20023742/how-do-i-remove-the-memory-limit-on-openmpi-processes

Is this limit easy to remove? I am unfortunately myself inexperienced with cython. For now I suppose I will just use numpy arrays, afaik, they do not suffer from this limit.

Failed to install with gcc-10.2.0 and openmpi-4.1.0

Hi,

I tried to install mpi4py using the command: pip install mpi4py, and failed with errors as:

Processing ./mpi4py-3.0.3.tar.gz
Installing collected packages: mpi4py
Running setup.py install for mpi4py ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-ysbgioyo-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-rrwi0q_a-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_src
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/mpi4py
copying src/mpi4py/init.py -> build/lib.linux-x86_64-3.6/mpi4py
copying src/mpi4py/bench.py -> build/lib.linux-x86_64-3.6/mpi4py
copying src/mpi4py/main.py -> build/lib.linux-x86_64-3.6/mpi4py
copying src/mpi4py/run.py -> build/lib.linux-x86_64-3.6/mpi4py
creating build/lib.linux-x86_64-3.6/mpi4py/futures
copying src/mpi4py/futures/aplus.py -> build/lib.linux-x86_64-3.6/mpi4py/futures
copying src/mpi4py/futures/init.py -> build/lib.linux-x86_64-3.6/mpi4py/futures
copying src/mpi4py/futures/_lib.py -> build/lib.linux-x86_64-3.6/mpi4py/futures
copying src/mpi4py/futures/pool.py -> build/lib.linux-x86_64-3.6/mpi4py/futures
copying src/mpi4py/futures/server.py -> build/lib.linux-x86_64-3.6/mpi4py/futures
copying src/mpi4py/futures/_base.py -> build/lib.linux-x86_64-3.6/mpi4py/futures
copying src/mpi4py/futures/main.py -> build/lib.linux-x86_64-3.6/mpi4py/futures
copying src/mpi4py/libmpi.pxd -> build/lib.linux-x86_64-3.6/mpi4py
copying src/mpi4py/init.pxd -> build/lib.linux-x86_64-3.6/mpi4py
copying src/mpi4py/MPI.pxd -> build/lib.linux-x86_64-3.6/mpi4py
creating build/lib.linux-x86_64-3.6/mpi4py/include
creating build/lib.linux-x86_64-3.6/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.linux-x86_64-3.6/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.linux-x86_64-3.6/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.linux-x86_64-3.6/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.linux-x86_64-3.6/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.linux-x86_64-3.6/mpi4py/include/mpi4py
running build_clib
MPI configuration: [mpi] from 'mpi.cfg'
MPI C compiler: /opt/openmpi-4.1.0-gcc1020/bin/mpicc
MPI C++ compiler: /opt/openmpi-4.1.0-gcc1020/bin/mpicxx
MPI F compiler: /opt/openmpi-4.1.0-gcc1020/bin/mpifort
MPI F90 compiler: /opt/openmpi-4.1.0-gcc1020/bin/mpif90
MPI F77 compiler: /opt/openmpi-4.1.0-gcc1020/bin/mpif77
checking for library 'lmpe' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
building 'mpe' dylib library
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
creating build/temp.linux-x86_64-3.6/src/lib-pmpi
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c src/lib-pmpi/mpe.c -o build/temp.linux-x86_64-3.6/src/lib-pmpi/mpe.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
warning: build_clib: command '/opt/openmpi-4.1.0-gcc1020/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "mpe" failed

checking for library 'vt-mpi' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
building 'vt' dylib library
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c src/lib-pmpi/vt.c -o build/temp.linux-x86_64-3.6/src/lib-pmpi/vt.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
warning: build_clib: command '/opt/openmpi-4.1.0-gcc1020/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "vt" failed

checking for library 'vt-mpi' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
building 'vt-mpi' dylib library
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c src/lib-pmpi/vt-mpi.c -o build/temp.linux-x86_64-3.6/src/lib-pmpi/vt-mpi.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
warning: build_clib: command '/opt/openmpi-4.1.0-gcc1020/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "vt-mpi" failed

checking for library 'vt-hyb' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.ompi' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
building 'vt-hyb' dylib library
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c src/lib-pmpi/vt-hyb.c -o build/temp.linux-x86_64-3.6/src/lib-pmpi/vt-hyb.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
warning: build_clib: command '/opt/openmpi-4.1.0-gcc1020/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "vt-hyb" failed

running build_ext
MPI configuration: [mpi] from 'mpi.cfg'
MPI C compiler:    /opt/openmpi-4.1.0-gcc1020/bin/mpicc
MPI C++ compiler:  /opt/openmpi-4.1.0-gcc1020/bin/mpicxx
MPI F compiler:    /opt/openmpi-4.1.0-gcc1020/bin/mpifort
MPI F90 compiler:  /opt/openmpi-4.1.0-gcc1020/bin/mpif90
MPI F77 compiler:  /opt/openmpi-4.1.0-gcc1020/bin/mpif77
checking for dlopen() availability ...
checking for header 'dlfcn.h' ...
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
failure.
checking for library 'dl' ...
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
checking for function 'dlopen' ...
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
building 'mpi4py.dl' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c src/dynload.c -o build/temp.linux-x86_64-3.6/src/dynload.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
warning: build_ext: command 'gcc' failed with exit status 1

warning: build_ext: building optional extension "mpi4py.dl" failed

checking for MPI compile and link ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c _configtest.c -o _configtest.o
cc1: fatal error: inaccessible plugin file /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin/annobin.so expanded from short plugin name annobin: No such file or directory
compilation terminated.
failure.
removing: _configtest.c _configtest.o
error: Cannot compile MPI programs. Check your configuration!!!

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-ysbgioyo-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-rrwi0q_a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-ysbgioyo-build/

How to solve this issue? Thanks in advance.

When should I use MPI.Init() & Finalize()

Hi, I'm writing a tutorial about mpi4py(but now only the Chinese version available and I will translate it to english soon). I have a question that what does MPI.Init() and Finalize() do? I check the source code in the mpi.pyx and the Init() do invoke the MPI_INIT(), but I don't find where it is invoked when just use comm = MPI.COMM_WORLD like the tutorial shows us. Where does the MPI.Init() invoked and should we call it explicitly?

mpi4py version compatible with Python > 3.9.0

Hi
Recently a user of one of my programs had difficulty installing mpi4py. Doing a careful review I realized that the problem is about compatibility. In the conda environment, many packages update the base version of python from 3.8.5 to 3.9.5 which is the latest. This conflicts with the current version of mpi4py (3.0.3) which is only compatible with python < 3.9.0a.
If installed directly from Github it works fine.
Although it is an alpha version, is it possible for you to release this update to the PyPi and anaconda repositories?

Thanks in advance

Mario S.

TestUtilDTLib fails on s390x: incorrect long double alignment

We discussed at #80 (comment) a test failure on s390x architecture:

FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='g')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 40 != 48

======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='G')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 72 != 80

Tests on s390x showed this:

#include <stddef.h>
#include <stdio.h>

typedef struct {char a; long double b; char c;} s;

int main() { 
  printf("long double has alignment %d\n", offsetof(s,b));
  printf("long double has size %d\n", sizeof(long double));
  printf("stuct s has size %d\n", sizeof(s));
}

gives

$ ./mtest2
long double has alignment 8
long double has size 16
stuct s has size 32

In python,

# import numpy as np                                                                                                                    
# print(np.dtype('c,g,c', align=True))
{'names':['f0','f1','f2'], 'formats':['S1','>f16','S1'], 'offsets':[0,8,24], 'itemsize':32, 'aligned':True}

and also in python,

from ctypes import *

class S(Structure):
    _fields_ = [
        ("a", c_char),
        ("b", c_longdouble),
        ("c", c_char),
    ]

print(sizeof(S))

returns 32.

The alignment of long double on s390x is not the same as that expected by mpi4py as found on other architectures.

Allreduce floating point issue again

Dear all,
I stumbled upon 1.7e-3 floating-point tolerance error when using MPI Allreduce:

import numpy as np
from mpi4py import MPI
from tqdm import tqdm

comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()


def compute_P_total():
    logP_rows = np.genfromtxt('logP_hist.txt')  # 1d array
    P_total = np.zeros(1, dtype=np.float32)
    for i, logP in enumerate(tqdm(logP_rows, disable=rank != 0)):
        if i % size == rank:
            P_total += np.exp(logP)
    # the correct P_total value is 0.94590753

    if size != 1:
        # MPI Allreduce
        totals = np.zeros_like(P_total)
        mpi_float_type = MPI.FLOAT if P_total.dtype == np.float32 else MPI.DOUBLE
        comm.Allreduce(
            [P_total, mpi_float_type],
            [totals, mpi_float_type],
            op=MPI.SUM)
        P_total = totals

    return P_total


print(compute_P_total())

Without MPI: 0.94590753
With MPI: 0.9476357 (ran with mpiexec -n 4 python -m script.py)

Link to the 'logP_hist.txt' file: https://www.dropbox.com/s/8nqs85yf6ycg0um/logP_hist.txt?dl=1

I'm wondering, is it a purely floating-point associative issue that the order of adding floats impacts the result or I'm wrongly reducing the result with MPI? If I change the data type to double (np.float64), the difference becomes negligible (1e-6).

Thanks.

3.1.1: sphinx warnings

Looks like current documentation is not fully sphinx 4.x ready.

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
running build_sphinx
Running Sphinx v4.1.2
making output directory... done
[autosummary] generating autosummary for: appendix.rst, citing.rst, index.rst, install.rst, intro.rst, mpi4py.MPI.rst, mpi4py.futures.rst, mpi4py.rst, mpi4py.run.rst, mpi4py.util.dtlib.rst, mpi4py.util.pkl5.rst, mpi4py.util.rst, overview.rst, reference.rst, tutorial.rst
[autosummary] generating autosummary for: /home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/reference/mpi4py.MPI.rst
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://numpy.org/doc/stable/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 16 added, 0 changed, 0 removed
reading sources... [100%] tutorial
WARNING: error while formatting arguments for mpi4py.profile: Handler <function update_annotations_using_type_comments at 0x7f122239e430> for event 'autodoc-before-process-signature' threw an exception (exception: wrapper loop when unwrapping mpi4py.profile)
WARNING: error while formatting arguments for mpi4py.get_config: Handler <function update_annotations_using_type_comments at 0x7f122239e430> for event 'autodoc-before-process-signature' threw an exception (exception: wrapper loop when unwrapping mpi4py.get_config)
WARNING: error while formatting arguments for mpi4py.get_include: Handler <function update_annotations_using_type_comments at 0x7f122239e430> for event 'autodoc-before-process-signature' threw an exception (exception: wrapper loop when unwrapping mpi4py.get_include)
WARNING: don't know which module to import for autodocumenting 'MPI' (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... mpi4py.1 { intro overview tutorial mpi4py mpi4py.MPI mpi4py.futures mpi4py.util mpi4py.util.pkl5 mpi4py.util.dtlib mpi4py.run reference reference/mpi4py.MPI citing install appendix } /home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:63: WARNING: 'any' reference target not found: Comm.Is_inter
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:63: WARNING: 'any' reference target not found: Comm.Is_intra
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:70: WARNING: 'any' reference target not found: COMM_SELF
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:70: WARNING: 'any' reference target not found: COMM_WORLD
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Comm.Get_size
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Comm.Get_rank
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Comm.Get_group
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Group
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Group
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Group.Union
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Group.Intersection
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Group.Difference
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Comm.Create
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:74: WARNING: 'any' reference target not found: Comm.Create_group
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:83: WARNING: 'any' reference target not found: Comm.Clone
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:83: WARNING: 'any' reference target not found: Comm.Dup
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:83: WARNING: 'any' reference target not found: Comm.Split
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:83: WARNING: 'any' reference target not found: Intracomm.Create_intercomm
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:83: WARNING: 'any' reference target not found: Intercomm.Merge
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:87: WARNING: 'any' reference target not found: Cartcomm
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:87: WARNING: 'any' reference target not found: Graphcomm
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:87: WARNING: 'any' reference target not found: Distgraphcomm
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:87: WARNING: 'any' reference target not found: Intracomm.Create_cart
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:87: WARNING: 'any' reference target not found: Intracomm.Create_graph
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:119: WARNING: 'any' reference target not found: Comm.Send
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:119: WARNING: 'any' reference target not found: Comm.Recv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:119: WARNING: 'any' reference target not found: Comm.Sendrecv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:140: WARNING: 'any' reference target not found: Comm.Isend
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:140: WARNING: 'any' reference target not found: Comm.Irecv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:140: WARNING: 'any' reference target not found: Request.Test
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:140: WARNING: 'any' reference target not found: Request.Wait
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:140: WARNING: 'any' reference target not found: Request.Cancel
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:162: WARNING: 'any' reference target not found: Comm.Send_init
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:162: WARNING: 'any' reference target not found: Comm.Recv_init
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:162: WARNING: 'any' reference target not found: Prequest
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:162: WARNING: 'any' reference target not found: Prequest.Start
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Bcast
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Scatter
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Gather
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Allgather
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Alltoall
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.scatter
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.gather
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.allgather
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.alltoall
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Scatterv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Gatherv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Allgatherv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Alltoallv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:196: WARNING: 'any' reference target not found: Comm.Alltoallw
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Comm.Reduce
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Comm.Reduce_scatter
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Comm.Allreduce
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Intracomm.Scan
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Intracomm.Exscan
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Comm.reduce
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Comm.allreduce
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Intracomm.scan
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: Intracomm.exscan
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: SUM
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: PROD
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:206: WARNING: 'any' reference target not found: MAX
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:265: WARNING: 'any' reference target not found: Intracomm.Spawn
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:265: WARNING: 'any' reference target not found: Comm.Get_parent
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Open_port
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Publish_name
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Intracomm.Accept
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Lookup_name
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Intracomm.Connect
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Intracomm.Accept
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Intracomm.Connect
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Comm.Disconnect
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Unpublish_name
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:274: WARNING: 'any' reference target not found: Close_port
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:309: WARNING: 'any' reference target not found: Win
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:309: WARNING: 'any' reference target not found: Win.Create
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:309: WARNING: 'any' reference target not found: Win.Free
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:315: WARNING: 'any' reference target not found: Win.Put
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:315: WARNING: 'any' reference target not found: Win.Get
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:315: WARNING: 'any' reference target not found: Win.Accumulate
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:315: WARNING: 'any' reference target not found: Win
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:322: WARNING: 'any' reference target not found: Win.Start
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:322: WARNING: 'any' reference target not found: Win.Complete
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:322: WARNING: 'any' reference target not found: Win.Post
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:322: WARNING: 'any' reference target not found: Win.Wait
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:322: WARNING: 'any' reference target not found: Win.Fence
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:322: WARNING: 'any' reference target not found: Win.Lock
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:322: WARNING: 'any' reference target not found: Win.Unlock
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:368: WARNING: 'any' reference target not found: File
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:368: WARNING: 'any' reference target not found: File.Open
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:368: WARNING: 'any' reference target not found: File.Close
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:368: WARNING: 'any' reference target not found: File.Delete
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:375: WARNING: 'any' reference target not found: File.Set_view
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:375: WARNING: 'any' reference target not found: File.Get_view
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:395: WARNING: 'any' reference target not found: Init
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:395: WARNING: 'any' reference target not found: Init_thread
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:395: WARNING: 'any' reference target not found: Finalize
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:395: WARNING: 'any' reference target not found: Is_initialized
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:395: WARNING: 'any' reference target not found: Is_finalized
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:402: WARNING: 'any' reference target not found: Init
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:402: WARNING: 'any' reference target not found: Init_thread
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:411: WARNING: 'any' reference target not found: Finalize
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:420: WARNING: 'any' reference target not found: Get_version
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:424: WARNING: 'any' reference target not found: Get_processor_name
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:427: WARNING: 'any' reference target not found: Comm.Get_attr
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:427: WARNING: 'any' reference target not found: COMM_WORLD
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:434: WARNING: 'any' reference target not found: Wtime
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:434: WARNING: 'any' reference target not found: Wtick
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:440: WARNING: 'any' reference target not found: ERRORS_RETURN
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:440: WARNING: 'any' reference target not found: ERRORS_ARE_FATAL
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:440: WARNING: 'any' reference target not found: Comm.Set_errhandler
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:440: WARNING: 'any' reference target not found: Comm.Get_errhandler
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:446: WARNING: 'any' reference target not found: ERRORS_RETURN
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:453: WARNING: 'any' reference target not found: ERRORS_RETURN
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:453: WARNING: 'any' reference target not found: COMM_SELF
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:453: WARNING: 'any' reference target not found: COMM_WORLD
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:453: WARNING: 'any' reference target not found: Win
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:453: WARNING: 'any' reference target not found: File
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/overview.rst:453: WARNING: 'any' reference target not found: ERRORS_ARE_FATAL
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:18: WARNING: 'any' reference target not found: Comm.scatter
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:18: WARNING: 'any' reference target not found: Comm.gather
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:35: WARNING: 'any' reference target not found: Comm.scatter
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:35: WARNING: 'any' reference target not found: Comm.gather
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:35: WARNING: 'any' reference target not found: Comm.allgather
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:35: WARNING: 'any' reference target not found: Comm.alltoall
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:35: WARNING: 'any' reference target not found: Comm.size
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:35: WARNING: 'any' reference target not found: Comm.size
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:54: WARNING: 'any' reference target not found: Comm.Send
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:54: WARNING: 'any' reference target not found: Comm.Recv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:54: WARNING: 'any' reference target not found: Comm.Bcast
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:54: WARNING: 'any' reference target not found: Comm.Scatter
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:54: WARNING: 'any' reference target not found: Comm.Gather
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:63: WARNING: 'any' reference target not found: Comm.Scatterv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/tutorial.rst:63: WARNING: 'any' reference target not found: Comm.Gatherv
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:58: WARNING: 'any' reference target not found: MPI.Intracomm.Spawn
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:58: WARNING: 'any' reference target not found: MPI.COMM_SELF
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:116: WARNING: 'any' reference target not found: MPI.Info
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:116: WARNING: 'any' reference target not found: MPI.Intracomm.Spawn
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:235: WARNING: 'any' reference target not found: MPI.THREAD_MULTIPLE
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:235: WARNING: 'any' reference target not found: MPI.THREAD_MULTIPLE
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:235: WARNING: 'any' reference target not found: MPI.THREAD_SERIALIZED
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:248: WARNING: 'any' reference target not found: MPI.THREAD_SERIALIZED
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:248: WARNING: 'any' reference target not found: MPI.THREAD_SINGLE
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:248: WARNING: 'any' reference target not found: MPI.THREAD_FUNNELED
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:283: WARNING: 'any' reference target not found: MPI.COMM_WORLD
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:303: WARNING: 'any' reference target not found: MPI.COMM_SELF
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:337: WARNING: 'any' reference target not found: MPI.COMM_WORLD
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.futures.rst:337: WARNING: 'any' reference target not found: MPI.COMM_WORLD
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.run.rst:9: WARNING: 'any' reference target not found: ERRORS_ARE_FATAL
/home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.1/docs/source/usrman/mpi4py.run.rst:9: WARNING: 'any' reference target not found: ERRORS_RETURN
done
build succeeded, 154 warnings.

Pi Calculation example

Might it be worth adding the following example code:

import numpy as np
import sys
import datetime
from mpi4py import MPI

def inside_circle(total_count):
  x = np.random.uniform(size=total_count)
  y = np.random.uniform(size=total_count)
  radii = np.sqrt(x*x + y*y)
  count = len (radii[np.where(radii<=1.0)])
  return count

def main():
  comm = MPI.COMM_WORLD
  n_cpus = comm.Get_size()
  rank = comm.Get_rank()
  n_samples = int(sys.argv[1])
  if rank == 0:
    my_samples = n_samples - ( n_cpus - 1 ) * np.int(np.floor(n_samples/n_cpus))
  else:
    my_samples = np.int(np.floor(n_samples/n_cpus))

  comm.Barrier()
  start_time = datetime.datetime.now()
  my_counts = inside_circle(my_samples)
  counts = comm.allreduce(my_counts,op=MPI.SUM)
  comm.Barrier()
  end_time = datetime.datetime.now()
  elapsed_time = (end_time - start_time).total_seconds()
  my_pi = 4.0 * counts / n_samples
  if rank == 0:
    print("Pi: {}, time: {} s".format(my_pi,elapsed_time))

if __name__ == '__main__':
  main()

There is a version of this used in HPC-Carpentry, but some of the commands are not so well documented in the tutorial

srun broken in SLURM script on 3.1.2

The SLURM script below stopped working when upgrading mpi4py from 3.1.1 to 3.1.2.

OPAL ERROR: Unreachable in file pmix3x_client.c at line 112
--------------------------------------------------------------------------
The application appears to have been direct launched using "srun", but OMPI was not built with SLURM's PMI support and therefore cannot execute. There are several options for building PMI support under SLURM, depending upon the SLURM version you are using:

   version 16.05 or later: you can use SLURM's PMIx support. This
   requires that you configure and build SLURM --with-pmix.

   Versions earlier than 16.05: you must use either SLURM's PMI-1 or
   PMI-2 support. SLURM builds PMI-1 by default, or you can manually
   install PMI-2. You must then build Open MPI using --with-pmi pointing
   to the SLURM PMI library location.

Please configure as appropriate and try again.
--------------------------------------------------------------------------
*** An error occurred in MPI_Init_thread
*** on a NULL communicator
*** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
***    and potentially your MPI job)
Local abort before MPI_INIT completed completed successfully, but am not able to aggregate error messages, and not able to guarantee that all other processes were killed!
srun: error: thor: task 0: Exited with exit code 1
===========================================
#!/bin/bash
#SBATCH --ntasks=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=31200m          
#SBATCH --gres=gpu:1                   
#SBATCH --gres-flags=enforce-binding

module use $HOME/MyModules
module load mambaforge_pic/latest

export MPICH_GPU_SUPPORT_ENABLED=1
export FBPIC_ENABLE_GPUDIRECT=1

srun -n 1 python script.py

Additional info:

slurm 19.05.2
mpi4py 3.1.2

Pickle serialization of communicator instances?

I am running into a use-case where I need to use pickle to serialize Cartcomm objects (distdl/distdl#224). Are there any plans to add this in the future, or any extensions which do this? If not, what would be the first steps needed to achieve this? I assume it is fairly complex because of the amount of FFI, etc.

no mpiexec: mpi4py.MPI.Exception: MPI_ERR_WIN: invalid window

When you don't use MPI wrappers to execute your script (mpiexec, mpirun, srun, ...) most mpi4py features function as if you're on an MPI process with rank 0 in an MPI world of size 1. However, when you use the MPI.Win.Create(buffer, True, MPI.INFO_NULL, MPI.COMM_WORLD) it throws the following error:

--------------------------------------------------------------------------
The OSC pt2pt component does not support MPI_THREAD_MULTIPLE in this release.
Workarounds are to run on a single node, or to use a system with an RDMA
capable network such as Infiniband.
--------------------------------------------------------------------------
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/c/Users/robin/Documents/GIT/mpilock/mpilock/__init__.py", line 12, in sync
    return WindowController(comm, master)
  File "/mnt/c/Users/robin/Documents/GIT/mpilock/mpilock/__init__.py", line 26, in __init__
    self._read_window = self._window(self._read_buffer)
  File "/mnt/c/Users/robin/Documents/GIT/mpilock/mpilock/__init__.py", line 38, in _window
    return MPI.Win.Create(buffer, True, MPI.INFO_NULL, self._comm)
  File "mpi4py/MPI/Win.pyx", line 72, in mpi4py.MPI.Win.Create
mpi4py.MPI.Exception: MPI_ERR_WIN: invalid window

I don't see why a Window also can't function in a world with size 1.

Typo in setup.py causes error when installing with pipenv

Currently, installing version 3.1.0 of mpi4py with pipenv (Pipfile) leads to the following error:

TypeError: 'LegacySpecifier' object is not iterable

while solving for dependencies. The python_requires item in setup.py has an additional ' at the end of the line, making it an invalid requirement string.

mpi4py/setup.py

Line 473 in 7296a19

>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*'

Using the hosts arguments of MPI_Comm_spawn with mpi4py

Hello,

I would like to use OpenMPI in order to do distributed computing over LAN network. However, I need to use dynamic process spawning (MPI_Comm_spawn).

OpenMPI has implemented (and documented) arguments to do this, such as hostfile. But this is not available on mpi4py.

Is it possible to add this feature?

Regards,

Hugo

Can't transmit large numpy array between nodes on hpc

I test my code use only one node on hpc, it works well, but when I use two nodes 48 cores to run the code(test.py), it went wrong, it seems that the data can't be transmitted successfully and the program hung up with nothing to show.

from mpi4py import MPI
import sys
import numpy as np

def print_hello(rank, size, name):
  msg = "Hello World! I am process {0} of {1} on {2}.\n"
  sys.stdout.write(msg.format(rank, size, name))

if __name__ == "__main__":
    comm = MPI.COMM_WORLD
    size = MPI.COMM_WORLD.Get_size()
    rank = MPI.COMM_WORLD.Get_rank()
    name = MPI.Get_processor_name()
    if rank == 0:
        data = np.random.random((48,36000))
        print(data.shape)
    else:
        data = None

    data = comm.scatter(data,root=0)
    print(data.shape)

    print_hello(rank, size, name)

However, if I changed the the number from 36000 to 3600, it works well and output is correct as I expected:

(3600,)
Hello World! I am process 8 of 48 on cn7783.
(3600,)
Hello World! I am process 9 of 48 on cn7783.
(3600,)
Hello World! I am process 10 of 48 on cn7783.
(3600,)
Hello World! I am process 2 of 48 on cn7783.
(3600,)
Hello World! I am process 11 of 48 on cn7783.
(3600,)
Hello World! I am process 3 of 48 on cn7783.
(3600,)
Hello World! I am process 1 of 48 on cn7783.
(3600,)
Hello World! I am process 12 of 48 on cn7783.
...
...
Hello World! I am process 40 of 48 on cn7784.
(3600,)
Hello World! I am process 46 of 48 on cn7784.
(48, 3600)
(3600,)
Hello World! I am process 0 of 48 on cn7783.
(3600,)
Hello World! I am process 47 of 48 on cn7784.

Is there a limitation when transmitting data? Is there anything else to avoid it?

mpi4py.futures unable to resolve imports of other modules in same package as main script

I'm trying to use the MPIPoolExecutor on a Beowulf HPC cluster running Maui and Torque. I have a Python project consisting of multiple files (so a package containing multiple modules). The project structure is basically like this:

my_project
  - __init__.py
  - my_main_script.py
  - my_other_module.py

Using the MPIPoolExecutor in the main script works fine until I want to import another module inside the same package.

This simple code inside my_main_script.py works without problems:

from mpi4py.futures import MPIPoolExecutor


def f(x):
    return x ** 2


if __name__ == '__main__':
    with MPIPoolExecutor() as executor:
        print(list(executor.map(f, range(10))))

To run the code, I used this command: mpiexec -n 4 -rf my_rank_file python -m mpi4py.futures my_main_script.py

However, let's say that the function f is imported from another file in the same folder, my_other_module.py. Then my_main_script.py looks like this:

from mpi4py.futures import MPIPoolExecutor
from my_other_module import f


if __name__ == '__main__':
    with MPIPoolExecutor() as executor:
        print(list(executor.map(f, range(10))))

When I run this with the same command, I get the following error: ModuleNotFoundError: No module named 'my_other_module'

The error only seems to occur on worker nodes, not on the master node.

I'm using Open MPI 1.8.8, mpi4py 3.0.3, and Python 3.8.7.

NVHPC: Unknown Compiler Flags

Hi,

I am trying to compile mpi4py with NVHPC 21.9, which is the follow-up product to the PGI compilers.

Performing a compile with the C/C++ compilers nvc/nvc++ fails with unknown compiler flags being passed to those compilers.

Error Message

...
  running build_clib
  MPI configuration: [mpi] from 'mpi.cfg'
  MPI C compiler:    /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/mpi/bin/mpicc
  MPI C++ compiler:  /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/mpi/bin/mpicxx
  MPI F compiler:    /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/mpi/bin/mpifort
  MPI F90 compiler:  /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/mpi/bin/mpif90
  MPI F77 compiler:  /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/mpi/bin/mpif77
  checking for library 'lmpe' ...
  /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/mpi/bin/mpicc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c _configtest.c -o _configtest.o
  nvc-Error-Unknown switch: -Wno-unused-result
  nvc-Error-Unknown switch: -fwrapv
  nvc-Error-Unknown switch: -fstack-protector-strong
  nvc-Error-Unknown switch: -fwrapv
  nvc-Error-Unknown switch: -fstack-protector-strong
  nvc-Error-Unknown switch: -Wdate-time
  failure.
...

Reproducer

docker run -it ubuntu:20.04
# Install NVHPC
apt -qqq update
apt install -y \
    build-essential     \
    ca-certificates     \
    cmake               \
    environment-modules \
    gnupg               \
    pkg-config          \
    wget

wget -q https://developer.download.nvidia.com/hpc-sdk/21.9/nvhpc-21-9_21.9_amd64.deb \
        https://developer.download.nvidia.com/hpc-sdk/21.9/nvhpc-2021_21.9_amd64.deb
apt install -y ./nvhpc-21-9_21.9_amd64.deb ./nvhpc-2021_21.9_amd64.deb
rm -rf ./nvhpc-21-9_21.9_amd64.deb ./nvhpc-2021_21.9_amd64.deb
apt install -y python3 python3-pip

source /etc/profile.d/modules.sh
module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/21.9

# Compile mpi4py
export CC=$(which nvc)
export CXX=$(which nvc++)

python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install --upgrade -v mpi4py

Extra info:

$ which mpicc 
/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/mpi/bin/mpicc
$ which mpicxx
/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/mpi/bin/mpicxx

$ mpicc --showme
nvc -I/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/openmpi/openmpi-3.1.5/include -Wl,-rpath -Wl,$ORIGIN:$ORIGIN/../../lib:$ORIGIN/../../../lib:$ORIGIN/../../../compilers/lib:$ORIGIN/../../../../compilers/lib:$ORIGIN/../../../../../compilers/lib -Wl,-rpath -Wl,/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/openmpi/openmpi-3.1.5/lib -L/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/openmpi/openmpi-3.1.5/lib -lmpi

$ mpicxx --showme
nvc++ -I/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/openmpi/openmpi-3.1.5/include -Wl,-rpath -Wl,$ORIGIN:$ORIGIN/../../lib:$ORIGIN/../../../lib:$ORIGIN/../../../compilers/lib:$ORIGIN/../../../../compilers/lib:$ORIGIN/../../../../../compilers/lib -Wl,-rpath -Wl,/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/openmpi/openmpi-3.1.5/lib -L/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/comm_libs/openmpi/openmpi-3.1.5/lib -lmpi_cxx -lmpi

CFLAGS and CXXFLAGS are empty.

I cannot spot where those GNU-ish flags come from in the pip/setuptools build logic...

Document difference between Comm.Barrier() and Comm.barrier()

There are two methods Comm.Barrier() and Comm.barrier(), which seem to be implemented differently:

# Barrier Synchronization
# -----------------------
def Barrier(self) -> None:
"""
Barrier synchronization
"""
with nogil: CHKERR( MPI_Barrier(self.ob_mpi) )

mpi4py/src/mpi4py/MPI/Comm.pyx

Lines 1557 to 1560 in ddefbb7

def barrier(self) -> None:
"""Barrier"""
cdef MPI_Comm comm = self.ob_mpi
return PyMPI_barrier(comm)

I guess one releases the GIL and the other doesn’t?

The upper vs. lower case convention seems to imply an analogy with the generic Python object interface vs. buffer-like object interface (e. g. Comm.Bcast() vs Comm.bcast()), but since MPI_Barrier() doesn’t communicate any data, it’s not obvious what the difference is here (if any). The docstrings unfortunately don’t have any more information either (“Barrier synchronization” vs. “Barrier”).

Examples in https://github.com/mpi4py/mpi4py/tree/master/demo/cuda-aware-mpi fail

To whom it may concern,

I built mpi4py from source with gcc-9.3, openmpi-4.1.1 and cuda-11.0 on a DGX A100 server.

When I try to run cuda-aware-mpi demos in the mpi4py repository I get the following error.

"TypeError: message: expecting buffer or list/tuple" from "mpi4py/MPI/msgbuffer.pxi", line 149, in mpi4py.MPI.message_simple when called from comm.Allreduce(sendbuf, recvbuf) on line 19 in use_cupy.py.

I get the same error when I install mpi4py from conda with the command shown below.

conda create -n mpi4py-conda mpi4py cupy numba cudatoolkit=11.0.

Does anyone know why I get this error and how to correct it?

I have attached the errors from my test of mpi4py installed from conda for reference.

John Low
Argonne National Laboratory
mpi4py cupy demo error.zip

Error when build using distutils

Hi,

I tried to build mpi4py-3.0.3.tar.gz using distutils with custom-built gcc-10.2.0 and openmpi-4.1.0.

$ python setup.py build --mpi=openmpi

It reported the following error:

checking for symbol 'MPI_LB' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c _configtest.c -o _configtest.o
In file included from _configtest.c:2:
_configtest.c: In function ‘main’:
/opt/openmpi-4.1.0-gcc1020/include/mpi.h:326:65: error: static assertion failed: "MPI_LB was removed in MPI-3.0.  Use MPI_Type_create_resized instead."
  326 | #define THIS_SYMBOL_WAS_REMOVED_IN_MPI30(symbol, new_symbol) 0; _Static_assert(0, #symbol " was removed in MPI-3.0.  Use " #new_symbol " instead.")
      |                                                                 ^~~~~~~~~~~~~~
/opt/openmpi-4.1.0-gcc1020/include/mpi.h:1132:24: note: in expansion of macro ‘THIS_SYMBOL_WAS_REMOVED_IN_MPI30’
 1132 | #        define MPI_LB THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_LB, MPI_Type_create_resized);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_configtest.c:5:23: note: in expansion of macro ‘MPI_LB’
    5 |   MPI_Datatype s; s = MPI_LB; (void)s;
      |                       ^~~~~~
failure.
removing: _configtest.c _configtest.o
checking for symbol 'MPI_UB' ...
/opt/openmpi-4.1.0-gcc1020/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c _configtest.c -o _configtest.o
In file included from _configtest.c:2:
_configtest.c: In function ‘main’:
/opt/openmpi-4.1.0-gcc1020/include/mpi.h:326:65: error: static assertion failed: "MPI_UB was removed in MPI-3.0.  Use MPI_Type_create_resized instead."
  326 | #define THIS_SYMBOL_WAS_REMOVED_IN_MPI30(symbol, new_symbol) 0; _Static_assert(0, #symbol " was removed in MPI-3.0.  Use " #new_symbol " instead.")
      |                                                                 ^~~~~~~~~~~~~~
/opt/openmpi-4.1.0-gcc1020/include/mpi.h:1131:24: note: in expansion of macro ‘THIS_SYMBOL_WAS_REMOVED_IN_MPI30’
 1131 | #        define MPI_UB THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_UB, MPI_Type_create_resized);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_configtest.c:5:23: note: in expansion of macro ‘MPI_UB’
    5 |   MPI_Datatype s; s = MPI_UB; (void)s;
      |                       ^~~~~~
failure.
removing: _configtest.c _configtest.o

How to solve this issue? Thanks in advance.

Spawnless MPIPoolExecutor implementation

The MPIPoolExecutor provided in mpi4py.futures uses MPI.Spawn, a function which is often deliberatly disabled on MPI implementations meant for HPC (such as CrayMPI) that use job schedulers that don't properly deal with dynamic process management. Could mpi4py provide an option to tell the MPIPoolExecutor not to spawn any additional processes but instead use the available world?

I have my own package that does this: https://github.com/Helveg/zwembad in case you'd want to look at how I dealt with the problem. In short on each worker a loop is created that keeps waiting for new functions to execute and send back the result of. On the master each job that's submitted to the pool starts a thread and returns a future. The thread sends the data to the worker and executes a blocking read for the result. When the thread receives the result the return value of the corresponding future is set.

mpi4py.futures and COMM_WORLD.r(): Blocking calls

I am trying to use mpi4py.futures with MpiProcessPool. When I do so, I aim to use the .send() and .recv methods of COMM_WORLD to send data from the master process to the worker processes. However, the workers never receive any message and block execution. Could you let me know whether MpiProcessPool is not meant to be used with send() and recv()?

Test crash with mpich 3.4.1

We seeing this with the latest Fedora Rawhide builds, may have started with update of mpich from 3.3.2 to 3.4.1:

testIsCommutative (test_op.TestOp) ... Assertion failed in file src/mpi/coll/op/op_commutative.c at line 98: ((op)&(0x000000ff)) < MPIR_OP_N_BUILTIN
/usr/lib64/mpich/lib/libmpi.so.12(MPL_backtrace_show+0x39) [0x7fcae6409639]
/usr/lib64/mpich/lib/libmpi.so.12(MPI_Op_commutative+0x4db) [0x7fcae6265b8b]
/builddir/build/BUILDROOT/mpi4py-3.0.3-7.fc35.x86_64/usr/lib64/python3.9/site-packages/mpich/mpi4py/MPI.cpython-39-x86_64-linux-gnu.so(+0x900b9) [0x7fcae6c140b9]
/lib64/libpython3.9.so.1.0(+0x117050) [0x7fcae7611050]
/lib64/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x6ed) [0x7fcae760388d]
/lib64/libpython3.9.so.1.0(+0x116303) [0x7fcae7610303]
/lib64/libpython3.9.so.1.0(+0x11e481) [0x7fcae7618481]
/lib64/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x480) [0x7fcae7603620]
/lib64/libpython3.9.so.1.0(+0x116303) [0x7fcae7610303]
/lib64/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x6ed) [0x7fcae760388d]
/lib64/libpython3.9.so.1.0(+0x10829d) [0x7fcae760229d]
/lib64/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xee) [0x7fcae760ffde]
/lib64/libpython3.9.so.1.0(+0x11e522) [0x7fcae7618522]
/lib64/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x330d) [0x7fcae76064ad]
/lib64/libpython3.9.so.1.0(+0x10829d) [0x7fcae760229d]
/lib64/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xee) [0x7fcae760ffde]
/lib64/libpython3.9.so.1.0(_PyObject_FastCallDictTstate+0x67) [0x7fcae760b507]
/lib64/libpython3.9.so.1.0(_PyObject_Call_Prepend+0x6c) [0x7fcae761715c]
/lib64/libpython3.9.so.1.0(+0x1b9ff2) [0x7fcae76b3ff2]
/lib64/libpython3.9.so.1.0(_PyObject_MakeTpCall+0x87) [0x7fcae760b9a7]
/lib64/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x5266) [0x7fcae7608406]
/lib64/libpython3.9.so.1.0(+0x10829d) [0x7fcae760229d]
/lib64/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xee) [0x7fcae760ffde]
RPM build errors:
/lib64/libpython3.9.so.1.0(+0x11e522) [0x7fcae7618522]
/lib64/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x330d) [0x7fcae76064ad]
/lib64/libpython3.9.so.1.0(+0x10829d) [0x7fcae760229d]
/lib64/libpython3.9.so.1.0(_PyFunction_Vectorcall+0xee) [0x7fcae760ffde]
/lib64/libpython3.9.so.1.0(_PyObject_FastCallDictTstate+0x67) [0x7fcae760b507]
/lib64/libpython3.9.so.1.0(_PyObject_Call_Prepend+0x6c) [0x7fcae761715c]
/lib64/libpython3.9.so.1.0(+0x1b9ff2) [0x7fcae76b3ff2]
/lib64/libpython3.9.so.1.0(_PyObject_MakeTpCall+0x87) [0x7fcae760b9a7]
/lib64/libpython3.9.so.1.0(_PyEval_EvalFrameDefault+0x5266) [0x7fcae7608406]
internal ABORT - process 0

https://koschei.fedoraproject.org/package/mpi4py

test_util_dtlib.TestUtilDTLib failure on Fedora Rawhide s390x

+ mpiexec -np 1 python3 test/runtests.py -v --no-builddir
/builddir/build/BUILD/mpi4py-3.1.1/test/runtests.py:76: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.util import get_platform
[[email protected]] Python 3.10 (/usr/bin/python3)
[[email protected]] MPI 3.1 (Open MPI 4.1.1)
[[email protected]] mpi4py 3.1.1 (/builddir/build/BUILDROOT/mpi4py-3.1.1-1.fc36.s390x/usr/lib64/python3.10/site-packages/openmpi/mpi4py)
--------------------------------------------------------------------------
The OSC pt2pt component does not support MPI_THREAD_MULTIPLE in this release.
Workarounds are to run on a single node, or to use a system with an RDMA
capable network such as Infiniband.
--------------------------------------------------------------------------
...
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='g')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 40 != 48
======================================================================
FAIL: testStruct4 (test_util_dtlib.TestUtilDTLib) (typecode='G')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mpi4py-3.1.1/test/test_util_dtlib.py", line 165, in testStruct4
    self.assertEqual(mt.extent, n*ex1)
AssertionError: 72 != 80
----------------------------------------------------------------------
Ran 1385 tests in 33.029s
FAILED (failures=2, skipped=191)

mpi4py wheels

A full wheelhouse with something like cibuildwheel could help reduce installation issues for standard users. People who need to build against specific MPI libraries can still get the source dists with the --no-binary flag. It would also help during doc (#26) and other CI pipelines.

CuPy MPI demo is failing for Bcast

Description

I'm trying to run a CuPy MPI demo. Allreduce example is working but Bcast and p2p examples are failing with the segmentation fault error:

Caught signal 11 (Segmentation fault: invalid permissions for mapped object at address 0x2b15b6a00310)

Env

  1. openmpi/4.0.1 build with CUDA support
  2. cuda/10.2.89
  3. mpi4py/3.1.0a0
  4. cupy-cuda102/8.5.0

Additional

I've tried to run the example with a single GPU and with multiple GPUs (manually specifying the Device dependent on a rank). In both cases I'm still getting the error.

KeyError in win.Get when fetching a buffer of structured numpy arrays.

When I try:

win = MPI.Win.Allocate(...)

buf = array([(0, 0), (0, 0), (0, 0)], dtype=[('a', '<u8'), ('b', '<u8')])
win.Get(buf, target_rank=0)

I get:

Traceback (most recent call last):
  File "test3.py", line 56, in <module>
    win.Get(buf, target_rank=0)
  File "mpi4py/MPI/Win.pyx", line 398, in mpi4py.MPI.Win.Get
  File "mpi4py/MPI/msgbuffer.pxi", line 1037, in mpi4py.MPI._p_msg_rma.for_get
  File "mpi4py/MPI/msgbuffer.pxi", line 995, in mpi4py.MPI._p_msg_rma.for_rma
  File "mpi4py/MPI/msgbuffer.pxi", line 203, in mpi4py.MPI.message_simple
  File "mpi4py/MPI/msgbuffer.pxi", line 145, in mpi4py.MPI.message_basic
KeyError: 'T{L:a:L:b:}'

However this works:

buf = array([(0, 0), (0, 0), (0, 0)], dtype=np.unint64)
win.Get(buf, target_rank=0)

(except that the structure information is lost -- and would have to be re-assembled after win.Get)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.