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

bindings: Fix Python serial program init when ADIOS2 has MPI enabled #2238

Merged
merged 2 commits into from
May 15, 2020

Conversation

bradking
Copy link
Collaborator

The one-argument adios2.ADIOS(...) constructor has two overloads when MPI is enabled: ADIOS(bool) and ADIOS(MPI4PY_Comm). The representation of MPI4PY_Comm is just an integer, so a call with a bool may try to convert it (and fail). Re-order the pybind11 definitions of these signatures so that the ADIOS(bool) is tried first. That way a call with a bool will use it and a call with a MPI4PY_Comm will not convert and fall back to the proper variant.

Also update the test suite to always add the Serial variant of the tests and additionally enable the MPI variants when possible. The Bindings.Python.BPWriteReadTypes.Serial test in particular covers the overload selection problem fixed here.

Fixes: #2233

@bradking bradking requested a review from chuckatkins May 13, 2020 17:51
@bradking
Copy link
Collaborator Author

This is blocked in CI by the problem discussed here.

@chuckatkins
Copy link
Contributor

Debian builds disabled. Please rebase.

bradking added 2 commits May 15, 2020 07:42
The one-argument `adios2.ADIOS(...)` constructor has two overloads
when MPI is enabled: `ADIOS(bool)` and `ADIOS(MPI4PY_Comm)`.  The
representation of `MPI4PY_Comm` is just an integer, so a call with
a `bool` may try to convert it (and fail).  Re-order the pybind11
definitions of these signatures so that the `ADIOS(bool)` is tried
first.  That way a call with a `bool` will use it and a call with
a `MPI4PY_Comm` will not convert and fall back to the proper variant.

Fixes: #2233
Always add the python bindings Serial tests.  Add the MPI tests when
ADIOS2 is built with MPI.
@chuckatkins chuckatkins merged commit fcda950 into ornladios:master May 15, 2020
@bradking bradking deleted the bindings-python branch May 15, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bindings/Python: Cannot initialize serial ADIOS if MPI is enabled
2 participants