For each of these libraries, the process of building the library was very similar. First, profiling versions of MPI_Init and MPI_Finalize must be written. The profiling versions of the other MPI routines are quite similar in style. The code in each looks like
int MPI_Xxx( . . . )
{
do something for profiling library
retcode = PMPI_Xxx( . . . );
do something else for profiling library
return retcode;
}
We generate these routines by writing the ``do something'' parts only once, in
schematic form, and then wrapping them around the PMPI_ calls
automatically. It is thus extremely easy to generate profiling libraries.