next up previous
Next: Fancy Implementation Up: The MPI Profiling Interface Previous: Definition

Plain implementation

One very straightforward way to solve the problem, requiring no unusual features in the compiler and linker, is just to build two complete copies of the MPI library, one in which every function has the prefix MPI and the other in which every function has the prefix PMPI. Then if the user code, profiling library, ``PMPI'' library, and MPI library are presented to the linker in that order, references will be resolved as in Figure 1.

  
Figure: Link libraries for profiling
1#1

Here the profiling library has defined an alternative definition of MPI_Bcast, in order to intercept calls to it from the user, but has not provided an alternate definition for MPI_Comm_rank.



Karen D. Toonen
1998-11-19