If the MPE libraries have been built, it is very easy to access the profiling libraries. The configure in the mpe directory determines the link path necessary for each profiling library (which varies slightly for each MPI implementation). This information is placed in the following variables:
If the MPI implementation being used is MPICH, then adding -mpilog to your link line will automatically link your program with the mpe and logging libraries ( -llmpi -lmpe). You will also need to add -lpmpich to your link line to link with the MPI profiling interface.
The configure in the mpe directory also determines the link path necessary to link Fortran programs with the logging library (which varies slightly for each MPI implementation). This path is stored in the variable FLIB_PATH and substituted in the Makefile in the mpe/test directory. A small Fortran program fpi is linked using this path during the make process and the result is written to the make output. If successful, then this path should also be used with your Fortran programs.
If the MPI implementation being used is MPICH, it is necessary to include the library -lfmpich ahead of the profiling libraries. This allows C routines to be used for implementing the profiling libraries for use by both C and Fortran programs. For example, to generate log files in a Fortran program, the library list is -lfmpich -llmpich -lmpe -lpmpich.
If the MPI implementation being used is not MPICH, it is necessary to include the file mpe_proff.o (sample MPI Fortran profiling library) ahead of the profiling libraries. This is not necessary with MPICH since the library -lfmpich is included on the link line. It should be noted here that there has not been extensive testing with profiling Fortran programs using MPI implementations other than MPICH.
It is possible to combine automatic logging with manual logging. Automatic logging will log all MPI calls and is achieved by linking with $LOG_LIB. Manual logging is achieved by the user inserting calls to the MPE routines around MPI calls. This way, only the chosen MPI calls will be logged. However, if a combination of these two types of logging is preferred, then the user must omit the call to MPE_Finish_log. Because all MPI calls will be logged, MPI_Finalize will call MPE_Finish_log.