Skip to content

Commit

Permalink
Merge pull request #2238 from bradking/bindings-python
Browse files Browse the repository at this point in the history
bindings: Fix Python serial program init when ADIOS2 has MPI enabled
  • Loading branch information
Chuck Atkins authored May 15, 2020
2 parents 278530d + b34d11c commit fcda950
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
18 changes: 9 additions & 9 deletions bindings/Python/py11glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ PYBIND11_MODULE(ADIOS2_PYTHON_MODULE_NAME, m)
const bool opBool = adios ? true : false;
return opBool;
})
.def(pybind11::init<const bool>(),
"adios2 module starting point "
"non-MPI, constructs an ADIOS class "
"object",
pybind11::arg("debugMode") = true)
.def(pybind11::init<const std::string &, const bool>(),
"adios2 module starting point non-MPI, constructs an ADIOS class "
"object",
pybind11::arg("configFile"), pybind11::arg("debugMode") = true)
#if ADIOS2_USE_MPI
.def(pybind11::init<const adios2::py11::MPI4PY_Comm, const bool>(),
"adios2 module starting point, constructs an ADIOS class object",
Expand All @@ -239,15 +248,6 @@ PYBIND11_MODULE(ADIOS2_PYTHON_MODULE_NAME, m)
pybind11::arg("configFile"), pybind11::arg("comm"),
pybind11::arg("debugMode") = true)
#endif
.def(pybind11::init<const bool>(),
"adios2 module starting point "
"non-MPI, constructs an ADIOS class "
"object",
pybind11::arg("debugMode") = true)
.def(pybind11::init<const std::string &, const bool>(),
"adios2 module starting point non-MPI, constructs an ADIOS class "
"object",
pybind11::arg("configFile"), pybind11::arg("debugMode") = true)
.def("DeclareIO", &adios2::py11::ADIOS::DeclareIO,
"spawn IO object component returning a IO object with a unique "
"name, throws an exception if IO with the same name is declared "
Expand Down
12 changes: 4 additions & 8 deletions testing/adios2/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@
#------------------------------------------------------------------------------#

function(add_python_mpi_test testname)
python_add_test(NAME Bindings.Python.${testname} SCRIPT Test${testname}.py
python_add_test(NAME Bindings.Python.${testname}.MPI SCRIPT Test${testname}.py
EXEC_WRAPPER ${MPIEXEC_COMMAND}
)
set_tests_properties(Bindings.Python.${testname} PROPERTIES
set_tests_properties(Bindings.Python.${testname}.MPI PROPERTIES
PROCESSORS "${MPIEXEC_MAX_NUMPROCS}"
)
endfunction()

python_add_test(NAME Bindings.Python.HighLevelAPI SCRIPT TestHighLevelAPI.py)
python_add_test(NAME Bindings.Python.HighLevelAPI.Serial SCRIPT TestHighLevelAPI.py)

if(NOT ADIOS2_HAVE_MPI)
python_add_test(NAME Bindings.Python.BPWriteReadTypes
SCRIPT TestBPWriteReadTypes_nompi.py
)
endif()
python_add_test(NAME Bindings.Python.BPWriteReadTypes.Serial SCRIPT TestBPWriteReadTypes_nompi.py)

if(ADIOS2_HAVE_MPI)
add_python_mpi_test(BPWriteReadTypes)
Expand Down

0 comments on commit fcda950

Please sign in to comment.