#include "petsc.h" PetscErrorCode PETSC_DLLEXPORT PetscLogEventRegister(PetscEvent *event, const char name[],PetscCookie cookie)Not Collective
name | - The name associated with the event | |
cookie | - The cookie associated to the class for this event, obtain either with PetscLogClassRegister() or use a predefined one such as KSP_COOKIE, SNES_COOKIE |
PetscEvent USER_EVENT; PetscCookie cookie; int user_event_flops; PetscLogClassRegister(&cookie,"class name"); PetscLogEventRegister(&USER_EVENT,"User event name",cookie); PetscLogEventBegin(USER_EVENT,0,0,0,0); [code segment to monitor] PetscLogFlops(user_event_flops); PetscLogEventEnd(USER_EVENT,0,0,0,0);
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 cookie is associated with each event so that classes of events can be disabled simultaneously, such as all matrix events. The user can either use an existing cookie, such as MAT_COOKIE, or create their own as shown in the example.
Level:intermediate
Location:src/sys/plog/plog.c
Index of all Profiling routines
Table of Contents for all manual pages
Index of all manual pages