next up previous
Next: Examining Event Logs with Up: The mpich Programming Environment Previous: Automatic Generation of Profiling

   
Tools for Profiling Library Management

The sample profiling wrappers for MPICH are distributed as wrapper definition code. The wrapper definition code is run through the 'wrappergen' utility to generate C code. See the README in mpich/profiling/wrappergen. Any number of wrapper definitions can be used together, so any level of profiling wrapper nesting is possible when using wrappergen.

A few sample wrapper definitions are provided with mpich:

timing
use MPI_Wtime() to keep track of the total number of calls to each MPI function, and the time spent within that function. Note that this simply checks the timer before and after the function call. It will not subtract time spent in calls to other functions.
logging
create logfile of all pt2pt function calls
vismess
pop up an X window that gives a simple visualization of all messages that are passed
allprof
all of the above
Note: these wrappers do not use any mpich-specific features, besides the MPE graphics and logging used by 'vismess' and 'logging', respectively. They should work on any MPI implementation.

They can be incorporated manually into your application. This will involve 3 changes to the building of your application:

To simplify it, some sample makefile sections have been created in mpich/profiling/lib:

  Makefile.timing - timing wrappers
  Makefile.logging - logging wrappers
  Makefile.vismess - animated messages wrappers
  Makefile.allprof - timing, logging, and vismess

To use these Makefile fragments:

  1. (optional) Add $(PROF_OBJ) to your application's dependency list:
        myapp:  myapp.o $(PROF_OBJ)

  2. Add $(PROF_FLG) to your compile line (CFLAGS):
        CFLAGS = -O $(PROF_FLG)

  3. Add $(PROF_LIB) to your link line, after your application's object
     code, but before the main MPI library:
        $(CLINKER) myapp.o -L$(MPIR_HOME)/lib/$(ARCH)/$(COMM) $(PROF_LIB) -lmpi

  4. (optional) Add $(PROF_CLN) to your clean target:
        rm -f *.o *~ myapp $(PROF_CLN)

  5. Include the desired Makefile fragment in your makefile:
        include $(MPIR_HOME)/profiling/lib/Makefile.logging


next up previous
Next: Examining Event Logs with Up: The mpich Programming Environment Previous: Automatic Generation of Profiling
Karen D. Toonen
1998-11-19