Thanks Lisandro! and that was fast! This looks like just what I need.
>PS: I still do not like this approach. The thing is that all your
>library functions need to written to accept a pointer to MPI_Comm.
>What if the library you are wrapping is not your own code and you have
>to pass a plain MPI_Comm instead of a pointer?
My libs only take an MPI_Comm (not a pointer), for a single method,
the constructor. I think that is pretty common for scientific libs
(e.g. an FFT lib) that is designed to be instantiated from another
parallel code (Python or otherwise). An instance of the lib just
needs to know (one time) what comm it is running on, so its internal
MPI calls can be consistent with the caller. If the caller wants to
setup different MPI communicators, e.g. on subsets of procs, then it
just instantiates the lib once per communicator.
Any lib like that just needs to provide an alternate constructor
that accepts MPI_Comm *, and converts it to an MPI_Comm. That's
what I'll now add to my libs.
>I'm still thinking on
>something better, but anyway the _addressof() function will stay there
>and will be available in the next release.
I am a newbie to mpi4py, so not clear which of these this means:
a) there is now a development version of mpi4py I could
grab that would have this feature
b) I need to do something special to my version of mpi4py
to add this feature, thus only I could use it
c) it will be available at some point soon in the main
version of mpi4py (when would that be?)
I ask, b/c I plan to now include this logic in the Python wrappers for
several libs that we distribute open-source, and advise our users to
use mpi4py if they want to use the libs from a parallel Python script.
So I'm also asking when it will be available for general
users of mpi4py.
Thanks again,
Steve