Automatic generation of profiling libraries


Up: Contents Next: Writing wrapper definitions Previous: Appendices

The profiling wrapper generator (wrappergen) has been designed to complement the MPI profiling interface. It allows the user to write any number of `meta' wrappers which can be applied to any number of MPI functions. Wrappers can be in separate files, and can nest properly, so that more than one layer of profiling may exist on indiividual functions.

Wrappergen needs three sources of input:

    1. A list of functions for which to generate wrappers.
    2. Declarations for the functions that are to be profiled. For speed and parsing simplicity, a special format has been used. See the file proto. The MPI-1 functions are in mpi_proto. The I/O functions from MPI-2 are in mpiio_proto.
    3. Wrapper definitions.
The list of functions is simply a file of whitespace-separated function names. If omitted, any forallfn or fnall macros will expand for every function in the declaration file.

If no function declarations are provided, the ones in mpi_proto are used (this is set with the PROTO_FILE definition in the Makefile).

The options to wrappergen are:

-w file
Add file to the list of wrapper files to use.
-f file
file contains a whitespace separated list of function names to profile.
-p file
file contains the special function prototype declarations.
-o file
Send output to file.

For example, to time each of the I/O routines, use
   cd mpe/profiling/lib 
   ../wrappergen/wrappergen -p ../wrappergen/mpiio_proto \ 
             -w time_wrappers.w > time_io.c 
The resulting code need only a version of MPI_Finalize to output the time values. That can be written either by adding MPI_Finalize and MPI_Init to mpiio_proto or through a fairly simple edit of the version produced when using mpi_proto instead of mpiio_proto.



Up: Contents Next: Writing wrapper definitions Previous: Appendices