Jeff Squyres wrote:
On Feb 11, 2010, at 4:13 PM, Eugene Loh wrote:
In the MPI standard, the portion discussing the PMPI profiling interface says:
3. document the implementation of different language
bindings of the MPI interface if they are layered on top
of each other, so that the profiler developer knows
whether she must implement the profile interface for
each binding, or can economise by implementing it
only for the lowest level routines.
http://www.mpi-forum.org/docs/mpi22-report/node313.htm#Node313
Do we have such documentation anywhere? I don't see this in the OMPI FAQ.
I played with this some. I wrote a Fortran program that called MPI_Send. I
wrote a Fortran wrapper that intercepted MPI_Send and called PMPI_Send. I
wrote a C wrapper that did the same thing. It appears that both wrappers got
called. So, it looks like we should advise users to provide *only* C wrappers
(unless they *also* want to intercept at the Fortran level).
Yes/no?
Yes. Mostly.
I believe there are a small number of exceptions to this... (/me checks...)
Ah yes, here's one: MPI_ERRHANDLER_CREATE() in Fortran does *not* call
MPI_Errhandler_create(). Instead, it calls the back-end
ompi_errhandler_create() function. There's obscure reasons for this that are
pretty uninteresting. To be clear: if you profile this function in both C and
Fortran and call it in Fortran, you *won't* see the corresponding C profile
function invoked.
I don't know if there's an easy way to generate a full list of functions like
this -- it might involve a troll through ompi/mpi/f77/*_f.c to see which ones
call MPI_* functions for their back-end functionality vs. which ones don't. I
think most call MPI_* functions.
And I can imagine there are cases where you'd rather write the wrapper
in the native language (e.g., Fortran) than C if handles are handled
differently or something.
Back to the opening question: is this documented anywhere? (Such
documentation *is* a requirement of the standard and OMPI is standard
conforming, y'know.)