12.4. Restricting Event Logging

Up: Contents Next: Interpreting -log_info Output: Informative Messages Previous: Profiling Multiple Sections of Code

By default, all PETSc operations are logged. To enable or disable the PETSc logging of individual events, one uses the commands

   PLogEventActivate(int event); 
   PLogEventDeactivate(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 ).

PETSc also provides routines that deactivate (or activate) logging for entire components of the library. Currently, the components that support such logging (de)activation are Mat (matrices), Vec (vectors), SLES (linear solvers, including KSP and PC components), and SNES (nonlinear solvers):

   PLogEventDeactivateClass(MAT_COOKIE); 
   PLogEventDeactivateClass(SLES_COOKIE); /* includes PC and KSP */ 
   PLogEventDeactivateClass(VEC_COOKIE); 
   PLogEventDeactivateClass(SNES_COOKIE); 
and
   PLogEventActivateClass(MAT_COOKIE); 
   PLogEventActivateClass(SLES_COOKIE);   /* includes PC and KSP */ 
   PLogEventActivateClass(VEC_COOKIE); 
   PLogEventActivateClass(SNES_COOKIE); 
Recall that the option -log_all produces extensive profile data, which can be a challenge for PETScView to handle due to the memory limitations of Tcl/Tk. Thus, one should generally use -log_all when running programs with a relatively small number of events or when disabling some of the events that occur many times in a code (e.g., VecSetValues(), MatSetValues()).

Section Using -log_mpe with Upshot/Nupshot gives information on the restriction of events in MPE logging.


Up: Contents Next: Interpreting -log_info Output: Informative Messages Previous: Profiling Multiple Sections of Code