PLogEventRegister

Registers an event name for logging operations in an application code.

Synopsis

#include "petsc.h"   
int PLogEventRegister(int *e,const char string[],const char color[])
Not Collective

Input Parameter

string - name associated with the event
color - (optional) string specifying a color and display pattern for viewing an event, used by Upshot/Nupshot to view logs generated by -log_mpe (e.g., - "red:", "green:vlines3"); use PETSC_NULL to let PETSc assign a color.

Output Parameter

e -event id for use with PLogEventBegin() and PLogEventEnd().

Example of Usage

      int USER_EVENT;
      int user_event_flops;
      PLogEventRegister(&USER_EVENT,"User event name","EventColor");
      PLogEventBegin(USER_EVENT,0,0,0,0);
         [code segment to monitor]
         PLogFlops(user_event_flops);
      PLogEventEnd(USER_EVENT,0,0,0,0);

Notes

PETSc automatically logs library events if the code has been compiled with -DPETSC_USE_LOG (which is the default) and -log, -log_summary, or -log_all are specified. PLogEventRegister() is intended for logging user events to supplement this PETSc information.

PETSc can gather data for use with the utilities Upshot/Nupshot (part of the MPICH distribution). If PETSc has been compiled with flag -DPETSC_HAVE_MPE (MPE is an additional utility within MPICH), the user can employ another command line option, -log_mpe, to create a logfile, "mpe.log", which can be visualized Upshot/Nupshot. The color argument is used by this utility in forming the display of this event; the standard X-windows color names should be used.

Keywords

log, event, register

See Also

PLogEventBegin(), PLogEventEnd(), PLogFlops(),
PLogEventMPEActivate(), PLogEventMPEDeactivate(), PLogEventActivate(), PLogEventDeactivate()

Examples

src/sles/examples/tutorials/ex9.c
src/sys/examples/tutorials/ex3f.F
src/sys/examples/tutorials/ex3.c

Level:intermediate
Location:src/sys/src/plog/plog.c
Logging Index
Table of Contents