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 that -DMPE_GRAPHICS be included in the flags to the C compiler.
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 (-lpmpich)> \ <standard mpi library (-lmpich)>
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 $(PROF_LIB) -lmpich
rm -f *.o * myapp $(PROF_CLN)
include $(MPIR_HOME)/mpe/profiling/lib/Makefile.logging