Prism 6.0 User's Guide

MPI Profiling Interface

The MPI standard supports a profiling interface, which allows any user to profile either individual MPI calls or the entire library. This facility is provided by supporting two equivalent APIs for each MPI routine. One has the prefix MPI_, while the other has PMPI_. User codes typically call the MPI_ routines. A profiling routine or library will typically provide wrappers for the MPI_ APIs that simply call the PMPI_ ones, with timer calls around the PMPI_ call.

More generally, you may use this interface to change the behavior of MPI routines without modifying your source code. For example, suppose you believe that most of the time spent in some collective call such as MPI_Allreduce is due to the synchronization of the processes that is implicit to such a call. Then, you might compile a wrapper such as the one shown below, and link it into your code before -lmpi. The effect will be that time profiled by MPI_Allreduce calls will be due will be due exclusively" to the all-reduce operation, with synchronization costs attributed to barrier operations.

subroutine MPI_Allreduce(x,y,n,type,op,comm,ier)
integer x(*), y(*), n, type, op, comm, ier
call PMPI_Barrier(comm,ier)
call PMPI_Allreduce(x,y,n,type,op,comm,ier)
end 

Profiling wrappers or libraries may be used even with application binaries that have already been linked. See the Solaris man page for ld for more information on the environment variable LD_PRELOAD.

Profiling libraries are available from independent sources for use with Sun MPI. Typically, their functionality is rather limited compared to that of Prism with TNF, but for certain applications their use may be more convenient or they may represent useful springboards for particular, customized profiling activities. An example of a profiling library is included in the multiprocessing environment (MPE) from Argonne National Laboratory. For more information on this library and on the MPI profiling interface, see the Sun MPI 4.0 Programming and Reference Guide.