Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing COMM_WORLD to context constructors fails if mpi4py is installed after arbor is built #1785

Closed
Helveg opened this issue Dec 7, 2021 · 4 comments · Fixed by #1940
Closed

Comments

@Helveg
Copy link
Collaborator

Helveg commented Dec 7, 2021

Describe the bug

A regression occurred where MPI communicators can no longer be passed to context:

>>> import arbor
>>> from mpi4py.MPI import COMM_WORLD
>>> arbor.context(mpi=COMM_WORLD)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
RuntimeError: mpi must be None, or an MPI communicator

Context
I'm on PizDaint's daint-gpu stack with Spack built Python.

@Helveg Helveg added the bug label Dec 7, 2021
@Helveg
Copy link
Collaborator Author

Helveg commented Dec 8, 2021

The CMake output reports -- Could NOT find PY_mpi4py (missing: PY_MPI4PY). So the ifdefs around all of the mpi4py comm logic are likely skipped. But installing mpi4py after building arbor seems like a valid user thing to do. Is detecting mpi4py at compile time really required to detect an mpi4py communicator at runtime?

@Helveg
Copy link
Collaborator Author

Helveg commented Jan 15, 2022

@bcumming any thoughts?

@Helveg Helveg changed the title Passing COMM_WORLD to context constructors fails. Passing COMM_WORLD to context constructors fails if mpi4py is installed after arbor is built Jan 15, 2022
@bcumming
Copy link
Member

@Helveg , sorry for the belated reply.

MPI4Py needs to be available if we are going to bake in support for Arbor, because it requires access to the C code of MPI4Py, specifically for the header files.

The reason being that MPI4Py does not expose the underlying MPI Communicator, the type of which also depends on the version of MPI that is being used (OpenMPI and MPICH use a pointer and an integer type respectively as the MPI_Comm type).

@Helveg
Copy link
Collaborator Author

Helveg commented Feb 11, 2022

Ok, could the error be clarified then? It's telling me I didn't pass an MPI communicator, but I did. Just that Arbor can't use mpi4py MPI communicators if it wasn't built with support for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants