I am lost ...
from ompi/mpi/fortran/mpif-h/profile/palltoall_f.c
void ompi_alltoall_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype,
char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype,
MPI_Fint *comm, MPI_Fint *ierr)
{
[...]
c_ierr = MPI_Alltoall(sendbuf,
OMPI_FINT_2_INT(*sendcount),
c_sendtype,
recvbuf,
OMPI_FINT_2_INT(*recvcount),
c_recvtype, c_comm);
[...]
}
$ nm ompi/mpi/fortran/mpif-h/profile/.libs/palltoall_f.o | grep MPI_Alltoall
U MPI_Alltoall
0000000000000000 W MPI_Alltoall_f
0000000000000000 W MPI_Alltoall_f08
0000000000000000 W PMPI_Alltoall_f
0000000000000000 W PMPI_Alltoall_f08
ompi_alltoall_f() calls MPI_Alltoall()
the "natural" way of writing a tool is to write mpi_alltoall_ (that
calls pmpi_alltoall_)
*and* MPI_Alltoall (that calls PMPI_Alltoall)
since ompi_alltoall_f invokes MPI_Alltoall (and not PMPI_Alltoall), the
tool is invoked twice, by both the Fortran and C wrapper.
my initial question was
"why does ompi_alltoall_f invokes MPI_Alltoall instead of PMPI_Alltoall ?"
/* since we share the same source code when building with or without mpi
profiling,
that means we would need to
#define MPI_Alltoall PMPI_Alltoall
when ompi is configure'd with --enable-mpi-profile
*/
of course, if the tool does not define its own MPI_Alltoall subroutine, then
then PMPI_Alltoall is invoked directly since MPI_Alltoall is a weak
symbol pointing to
PMPI_Alltoall.
Cheers,
Gilles
On 8/26/2015 9:39 AM, Jeff Squyres (jsquyres) wrote:
On Aug 25, 2015, at 11:03 AM, George Bosilca <bosi...@icl.utk.edu> wrote:
This seems to be the case only with the TKR interface. All the others are
either calling the OMPI version directly (mpif-h), or are calling some other
internal (or weak symbol function).
Yes, those might need to be updated. Not it! (let's let the TKR interface
die...)
You're right about the mpif-h interface, though -- they call the PMPI versions
of the functions (through weak symbols).
However, our use of weak symbols might be confusing to the tool -- is it somehow
intercepting our call from ompi_send_f() to PMPI_Send(), for example? You might want to
step through with a debugger to see what's happening, because the debugger should show
the name of the symbol that is invoked in the call stack, even though the pointer in the
source code may show you in "MPI_Send()" (remember: we compile the C code for
our functions potential with #defines that turn MPI_Send into PMPI_Send, etc.).