12.1.4. Using -log_mpe with Upshot/Nupshot

Up: Contents Next: Profiling Application Codes Previous: Using -log and -log_all with PETScView

It is also possible to use the Upshot (or Nupshot) package [11] to visualize PETSc events. This package comes with the MPE software, which is part of the MPICH [9] implementation of MPI. The option

   -log_mpe [logfile] 
creates a logfile of events appropriate for viewing with Upshot. The user can either use the default logging file, mpe.log, or specify an optional name via logfile.

To use this logging option, the user may employ any implementation of MPI (not necessarily MPICH), but must build and link the MPE part of the MPICH. The user must compile the PETSc library with the -DHAVE_MPE flag, which is not activated by default. The user can turn on MPE logging by specifying -DHAVE_MPE in the PCONF variable within ${}PETSC_DIR/bmake/${}PETSC_ARCH/base.site and (re)compiling all of PETSc.

By default, not all PETSc events are logged with MPE. For example, since MatSetValues() may be called thousands of times in a program, by default its calls are not logged with MPE. To activate MPE logging of a particular event, one should use the command

    PLogEventMPEActivate(int event); 
To deactivate logging of an event for MPE, one should use
    PLogEventMPEDeactivate(int event); 
The event may be either a predefined PETSc event (as listed in the file ${}PETSC_DIR/include/petsclog.h) or one obtained with PetscEventRegister() (as described in Section Profiling Application Codes ). These routines may be called as many times as desired in an application program, so that one could restrict MPE event logging only to certain code segments.

To see what events are logged by default, the user can view the source code; see the files src/plot/src/plogmpe.c and include/petsclog.h. A simple program and GUI interface to see the events that are predefined and their definition is being developed.

The user can also log MPI events. To do this, simply consider the PETSc application as any MPI application, and follow the MPI implementation's instructions for logging MPI calls. For example, when using MPICH, this merely required adding -llmpi to the library list before -lmpi.


Up: Contents Next: Profiling Application Codes Previous: Using -log and -log_all with PETScView