# PetscLogFlops

Adds floating point operations to the global counter.

### Input Parameter

f -flop counter

### Synopsis

    void PetscLogFlops(int f)

### Usage

         int USER_EVENT;
         PetscLogEventRegister(&USER_EVENT,"User event");
         PetscLogEventBegin(USER_EVENT,0,0,0,0);
            [code segment to monitor]
            PetscLogFlops(user_flops)
         PetscLogEventEnd(USER_EVENT,0,0,0,0);

### Notes

A global counter logs all PETSc flop counts. The user can use PetscLogFlops() to increment this counter to include flops for the application code.

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. PetscLogFlops() is intended for logging user flops to supplement this PETSc information.

### See Also

PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscGetFlops()

### Keywords

log, flops, floating point operations

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

### Examples

src/sys/examples/tutorials/ex3.c.html
src/sys/examples/tutorials/ex3f.F.html
src/ksp/examples/tutorials/ex9.c.html
src/snes/examples/tutorials/ex5.c.html
src/snes/examples/tutorials/ex5s.c.html
src/snes/examples/tutorials/ex14.c.html
src/snes/examples/tutorials/ex18.c.html
src/snes/examples/tutorials/ex19.c.html
src/snes/examples/tutorials/ex20.c.html
src/snes/examples/tutorials/ex22.c.html
src/snes/examples/tutorials/ex23.c.html