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). These variables are first substituted in the Makefile in the directory mpe/contrib/test. The Makefile is then installed into directory share/examples during the final installation process. This information is placed in the following variables:
PROF_LIBS - The compiler flag needed to link with the mpe library only. The link path is -lmpe -lpmpich or -lmpe -lpmpi depending on the MPI implementation.
LOG_LIBS - The compiler flag needed to link with the logging libraries. The logging libraries log all MPI calls and generate log file. The link path is -llmpe $PROF_LIB.
TRACE_LIBS - The compiler flag needed to link with the tracing library. The tracing library will trace all MPI calls. Each MPI call is preceded by a line that contains the rank in MPI_COMM_WORLD of the calling process, and followed by another line indicating that the call has completed. Most send and receive routines also indicate the values of count, tag, and partner (destination for sends, source for receives). Output is to standard output. The link path is -ltmpe $PROF_LIB.
ANIM_LIBS - The compiler flag needed to link with the animation library. The animation library produces a real-time animation of the program. This requires the MPE graphics, and uses X11 Window System operations. You may need to provide a specific path for the X11 libraries (instead of -lX11). The link path is -lampe $PROF_LIB -lX11.
F2CMPI_LIBS - The compiler flag needed to link Fortran to C MPI wrapper library with all the above mentioned libraries. For MPICH, this should be -lfmpich. Otherwise, it could be -lmpe_f2cmpi, MPE's own Fortran to C MPI wrapper library.
FLIB_PATH - The full compiler flag needed to link Fortran MPI programs with the logging library.
If the MPI implementation being used is MPICH, then adding compiler flag -mpilog to MPICH's mpicc/mpif77 will automatically link user program with MPE's logging libraries ( -llmpe -lmpe). Library link path -lpmpich is also linked with the MPI profiling interface when -mpilog flag is used
If a Fortran MPI program is linked with 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 linkage flag is -lfmpich -llmpe -lmpe -lpmpich. Using mpif77 -mpilog will automatically link with all these libraries.
If the MPI implementation being used is not MPICH, it is necessary to include the library -lmpe_f2cmpi (MPE's own Fortran to C MPI wrapper library) instead of library -lfmpich. Again this has to be linked before any of the profiling libraries. So the compiler linkage flag will be -lmpe_f2cmpi -llmpe -lmpe -lpmpi -lmpi.
It is possible to combine automatic logging with manual logging. Automatic logging will log all MPI calls and is achieved by linking with $LOG_LIBS. 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 NOT call MPE_Init_log and MPE_Finish_log in the user program. Because in the linked logging library, MPI_Init will call MPE_Init_log and MPI_Finalize will call MPE_Finish_log.