Even simpler, you could just write a macro wrapper around MPI_Send (as
opposed to C code). However, if your calls are happening inside a
precompiled library (and you don't have source code for it or don't want to
recompile it) then this won't work and you'd want a real profiler. However,
I don't think you should be tracking PMPI_* calls anyway; those are
implementatiopn details and not user exposed APIs. Am I right, Jeff?
Durga


On 4/4/07, Jeff Squyres <jsquy...@cisco.com> wrote:

On Apr 4, 2007, at 11:12 AM, po...@cc.gatech.edu wrote:

> I want to see how profiling is done .I need to track open mpi _send
> command.
> And so need to see how profiling is done.I dont know how to use
> PMPI_SEND.
> Can anybody help me???

Generally, you just write an MPI_Send function yourself, like this:

my_send.c:

include "mpi.h"
int MPI_Send(void *buf, int count, MPI_Datatype type, int dest,
             int tag, MPI_Comm comm) {
  int ret;
  /* ...gather whatever statistics you want ... */
  ret = PMPI_Send(buf, count, type, dest, tag, comm);
  /* ...gather whatever statistics you want ... */
  return ret;
}

Then compile my_send.c into your application (either as a standalone
library or as part of the application itself).  It'll naturally
intercept all calls to MPI_Send (as long as it is the rightmost
linker unit before -lmpi on the command line -- so, when using the
wrapper compilers, the last linker unit on the right, since "-lmpi"
is added automatically by the wrapper compilers), do your stats
gathering, invoke the back-end PMPI function, etc.

See chapter 8 of the MPI-1 standard for more information:

    http://www.mpi-forum.org/docs/mpi-11-html/node152.html#Node152

--
Jeff Squyres
Cisco Systems

_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users




--
Its a battle between humans and communists;
Which side are you in?
.

Reply via email to