From: abn Date: Tue, 25 Apr 2023 19:23:08 +0000 (+0200) Subject: Doc: indicating how to pass MPI_Comm from mpi4py X-Git-Tag: V9_11_0a1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e5fdbdb5b43139eff6d6ffb29ab237eb5824d357;p=tools%2Fmedcoupling.git Doc: indicating how to pass MPI_Comm from mpi4py --- diff --git a/doc/developer/doxygen/doxfiles/reference/cpp/cpp.dox b/doc/developer/doxygen/doxfiles/reference/cpp/cpp.dox index 3b2e87c45..ef1d78da0 100644 --- a/doc/developer/doxygen/doxfiles/reference/cpp/cpp.dox +++ b/doc/developer/doxygen/doxfiles/reference/cpp/cpp.dox @@ -21,5 +21,8 @@ data or not. For advanced usage, one has to be aware of the stamping mechanism used internally to know whether an instance has been modified or not. This is described in the second page above: \ref MEDCouplingTimeLabelPage + +If your interested into wrapping your C++ code to Python with SWIG and intend to do this in a parallel context +you might also want to check \ref swig_mpi. */ diff --git a/doc/developer/doxygen/doxfiles/reference/misc/misc.dox b/doc/developer/doxygen/doxfiles/reference/misc/misc.dox index 529c6fce2..453235677 100644 --- a/doc/developer/doxygen/doxfiles/reference/misc/misc.dox +++ b/doc/developer/doxygen/doxfiles/reference/misc/misc.dox @@ -7,6 +7,6 @@ anywhere else in the documentation. - \subpage tools - \subpage icoco - \subpage MEDCouplingFieldTemplatesPage - +- \subpage swig_mpi */ diff --git a/doc/developer/doxygen/doxfiles/reference/misc/swig_mpi.dox b/doc/developer/doxygen/doxfiles/reference/misc/swig_mpi.dox new file mode 100644 index 000000000..84004333e --- /dev/null +++ b/doc/developer/doxygen/doxfiles/reference/misc/swig_mpi.dox @@ -0,0 +1,24 @@ +/*! + +\page swig_mpi Passing a MPI communicator to a SWIG-ed interface + +This is not directly linked to MEDCoupling, but the following issue often +arises when wrapping a C++ code to Python using the SWIG tool (for example, to be able +to couple two codes in Python). + +If you want to be able to pass a communicator defined on the Python side (typically with the +Python module mpi4py) to your C++ code (which you have wrapped with SWIG), the following +magic lines need to be inserted into your ".i" file for this to work correctly: + +\code{.cpp} +%include /usr/lib/python3/dist-packages/mpi4py/include/mpi4py/mpi4py.i +%mpi4py_typemap(Comm, MPI_Comm); + +.... +void method_taking_a_MPI_Comm(MPI_Comm mpicomm); +... +\endcode + +where the path to mpi4py.i needs to be adapted to your configuration. + +*/