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 Section Automatic generation of profiling libraries . 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:
You can incorporate them manually into your application, which involves three changes to the building of your application:
Generate the source code for the desired wrapper(s) with wrappergen. This can be a one-time task.
Compile the code for the wrapper(s). Be sure to supply the needed compile-line parameters. `vismess' and `logging' require the MPE library (-lmpe), and the `vismess' wrapper definition requires MPE_GRAPHICS.
Link the compiled wrapper code, the profiling version of the mpi library, and any other necessary libraries (`vismess' requires X) into your application. The required order is:
$(CLINKER) <application object files...> \ <wrapper object code> \ <other necessary libraries (-lmpe)> \ <profiling mpi library (-lpmpi)> \ <standard mpi library (-lmpi)>
Makefile.timing - timing wrappers Makefile.logging - logging wrappers Makefile.vismess - animated messages wrappers Makefile.allprof - timing, logging, and vismessTo use these Makefile fragments:
myapp: myapp.o $(PROF_OBJ)
CFLAGS = -O $(PROF_FLG)
$(CLINKER) myapp.o -L$(MPIR_HOME)/lib/$(ARCH)/$(COMM) $(PROF_LIB) -lmpi
rm -f *.o * myapp $(PROF_CLN)
include $(MPIR_HOME)/profiling/lib/Makefile.logging(or
#include $(MPIR_HOME)/profiling/lib/Makefile.loggingif you are using the wildly incompatible BSD 4.4-derived make)