-
Notifications
You must be signed in to change notification settings - Fork 51
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
mpi4py #454
mpi4py #454
Conversation
src/binding/python/Series.cpp
Outdated
//! https://bitbucket.org/mpi4py/mpi4py/src/3.0.0/demo/wrap-c/helloworld.c | ||
// if( import_mpi4py() < 0 ) { here be dragons } | ||
|
||
MPI_Comm *mpiCommPtr = PyMPIComm_Get(comm.ptr()); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
//! @todo perform mpi4py import test? | ||
//! required C-API init? | ||
//! https://bitbucket.org/mpi4py/mpi4py/src/3.0.0/demo/wrap-c/helloworld.c | ||
// if( import_mpi4py() < 0 ) { here be dragons } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trying to avoid mpi4py/mpi4py.h
include:
Function generated during build. This just seems to import and perform tests on functions and type signatures for binary compatibility (e.g. the usual: MPI during build time must be MPI at runtime).
Afterwards the imported test module is unloaded again. We can probably skip it and check e.g. versions with pybind11
's import method.
8d9137a
to
5bb349c
Compare
CMakeLists.txt
Outdated
@@ -276,6 +276,11 @@ if(openPMD_HAVE_PYTHON) | |||
INTERFACE pybind11::pybind11) | |||
endif() | |||
|
|||
# TODO: Check if mpi4py is available | |||
# ref: https://github.com/ornladios/ADIOS2/blob/v2.3.0/cmake/FindPythonModule.cmake | |||
# find_package(PythonModule REQUIRED COMPONENTS mpi4py mpi4py/mpi4py.h) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
src/binding/python/Series.cpp
Outdated
"(Mismatched MPI at compile vs. runtime?)"); | ||
} | ||
|
||
return new Series(filepath, at, *mpiCommPtr); //! @todo do we already clone the communicator? |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
4b42ad4
to
b1b0905
Compare
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${examplename}.py | ||
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} | ||
) | ||
endif() |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
b72c2f6
to
4a97a1f
Compare
9414398
to
e3dc89c
Compare
Add bindings for passing an mpi4py MPI communicator to our Python `Series` object. Also prepare CMake logic for examples.
translate the parallel C++ examples to Python
Document required versions and its support.
// pyMPI: ... (todo) | ||
py::str const comm_pystr = py::repr(comm); | ||
std::string const comm_str = comm_pystr.cast<std::string>(); | ||
if( comm_str.substr(0, 12) != std::string("<mpi4py.MPI.") ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably only match mpi4py
Communicators (and derived/same-layouted objects)
Define an "openPMD-api[mpi]" optional variant in setup.py, which will pull mpi4py.
Add support for MPI-parallel I/O in python3 bindings.
Close #99
To Do
setup.py