bindings: Fix Python serial program init when ADIOS2 has MPI enabled #2238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The one-argument
adios2.ADIOS(...)
constructor has two overloads when MPI is enabled:ADIOS(bool)
andADIOS(MPI4PY_Comm)
. The representation ofMPI4PY_Comm
is just an integer, so a call with abool
may try to convert it (and fail). Re-order the pybind11 definitions of these signatures so that theADIOS(bool)
is tried first. That way a call with abool
will use it and a call with aMPI4PY_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