petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscLogEventRegister

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

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscLogEventRegister(const char name[],PetscClassId classid,PetscLogEvent *event)

Not Collective Many br

### Input Parameter

| name | - The name associated with the event Many br
| classid | - The classid associated to the class for this event, obtain either with Many brPetscClassIdRegister() or use a predefined one such as KSP_CLASSID, SNES_CLASSID, the predefined ones Many brare only available in C code Many br

### Output Parameter

event -The event id for use with PetscLogEventBegin() and PetscLogEventEnd(). Many br

### Example of Usage

          PetscLogEvent USER_EVENT;
          PetscClassId classid;
          PetscLogDouble user_event_flops;
          PetscClassIdRegister("class name",&classid);
          PetscLogEventRegister("User event name",classid,&USER_EVENT);
          PetscLogEventBegin(USER_EVENT,0,0,0,0);
             [code segment to monitor]
             PetscLogFlops(user_event_flops);
          PetscLogEventEnd(USER_EVENT,0,0,0,0);

Many br

### Notes

PETSc automatically logs library events if the code has been Many brconfigured with --with-log (which is the default) and Many br-log_view or -log_all is specified. PetscLogEventRegister() is Many brintended for logging user events to supplement this PETSc Many brinformation. Many br

PETSc can gather data for use with the utilities Jumpshot Many br(part of the MPICH distribution). If PETSc has been compiled Many brwith flag -DPETSC_HAVE_MPE (MPE is an additional utility within Many brMPICH), the user can employ another command line option, -log_mpe, Many brto create a logfile, "mpe.log", which can be visualized Many brJumpshot. Many br

The classid is associated with each event so that classes of events Many brcan be disabled simultaneously, such as all matrix events. The user Many brcan either use an existing classid, such as MAT_CLASSID, or create Many brtheir own as shown in the example. Many br

If an existing event with the same name exists, its event handle is Many brreturned instead of creating a new event. Many br

Many br

### Keywords

log, event, register

### See Also

PetscLogEventBegin(), PetscLogEventEnd(), PetscLogFlops(),
PetscLogEventMPEActivate(), PetscLogEventMPEDeactivate(), Many brPetscLogEventActivate(), PetscLogEventDeactivate(), PetscClassIdRegister() Many br

Level:intermediate
Location:src/sys/logging/plog.c
Index of all Profiling routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/sys/classes/random/examples/tutorials/ex1.c.html
src/sys/examples/tutorials/ex3.c.html
src/sys/examples/tutorials/ex3f.F.html
src/vec/vec/examples/tutorials/ex5.c.html
src/vec/vec/examples/tutorials/ex10.c.html
src/vec/vec/examples/tutorials/ex15.c.html
src/ksp/ksp/examples/tutorials/ex4.c.html
src/ksp/ksp/examples/tutorials/ex9.c.html
src/snes/examples/tutorials/ex12.c.html
src/snes/examples/tutorials/ex62.c.html
src/snes/examples/tutorials/ex77.c.html