Accessing the profiling libraries


Up: The MPE library of useful extensions Next: Automatic generation of profiling libraries Previous: Known Bugs

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:

PROF_LIB
The path needed to link with the mpe library only. The link path is -lmpe -lpmpich or -lmpe -lpmpi depending on the MPI implementation.
LOG_LIB
The path needed to link with the logging library. The logging library will log all MPI calls and generate a CLOG file (which can be viewed with jumpshot) or an ALOG file (which can be viewed with upshot). If a CLOG file is preferred, be sure to set MPE_LOG_FORMAT to CLOG. The link path is -llmpi $PROF_LIB.
TRACE_LIB
The path 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 -ltmpi $PROF_LIB.
ANIM_LIB
The path 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 -lampi $PROF_LIB -lX11.

These variables are substituted in the Makefile in the mpe/contrib/test directory. As part of the make process, a small C program cpi is linked with each profiling library. The result of each link test will be written as part of the make output. If the link test is successful, then these link paths should be used for your programs as well.

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.



Up: The MPE library of useful extensions Next: Automatic generation of profiling libraries Previous: Known Bugs