Jeff,

i filed PR #845 https://github.com/open-mpi/ompi/pull/845

could you please have a look ?

Cheers,

Gilles

On 8/30/2015 9:20 PM, Gilles Gouaillardet wrote:
ok, will do

basically, I simply have to
#include "ompi/mpi/c/profile/defines.h"
if configure set the WANT_MPI_PROFILING macro
(since this is an AM_CONDITIONAL, I will have the Makefile.am sets the CPP flags for the compiler)

makes sense ?

/* the patch will be pretty large since all *_f files are impacted, and for mpif-h only, so i'd rather ask before I fill the pr, and even if a sed command will do most of the job */

Cheers,

Gilles

On Saturday, August 29, 2015, Jeff Squyres (jsquyres) <jsquy...@cisco.com <mailto:jsquy...@cisco.com>> wrote:

    On Aug 27, 2015, at 3:25 AM, Gilles Gouaillardet
    <gil...@rist.or.jp <javascript:;>> wrote:
    >
    > I am lost ...

    Fortran does that to ya.  ;-)

    > 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)

    Sidenote: the only correct way to write a tool that intercepts
    Fortran MPI API calls is to write those interceptions *in
    Fortran*.  I.e., the tool should provide MPI_ALLTOALL as a Fortran
    subroutine.  I realize that this is not the point of what you are
    saying :-), but everyone always gets this point wrong, so I feel
    the need to keep pointing this out.

    > since ompi_alltoall_f invokes MPI_Alltoall (and not
    PMPI_Alltoall), the tool is invoked twice, by both the Fortran and
    C wrapper.

    I didn't think that this was true, but I just confirmed it by
    looking at "gcc -E" output in the mpif-h/profile directory.

    I don't think that it was the intent.  See below.

    > 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
    > */

    I'm guessing that the complexity in the build system to support
    environments without and with weak symbols (i.e., OS X vs. just
    about everyone else) have made this get lost over time.

    Can you supply a patch?

    --
    Jeff Squyres
    jsquy...@cisco.com <javascript:;>
    For corporate legal information go to:
    http://www.cisco.com/web/about/doing_business/legal/cri/

    _______________________________________________
    devel mailing list
    de...@open-mpi.org <javascript:;>
    Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
    Link to this post:
    http://www.open-mpi.org/community/lists/devel/2015/08/17897.php



_______________________________________________
devel mailing list
de...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
Link to this post: 
http://www.open-mpi.org/community/lists/devel/2015/08/17899.php

Reply via email to