PetscLogFlops — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscLogFlops

Adds floating point operations to the global counter.

## Synopsis

    #include <petsclog.h>
    PetscErrorCode PetscLogFlops(PetscLogDouble f)

Not Collective

## Input Parameter

- f - flop counter

## Example Usage

      PetscLogEvent USER_EVENT;

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

## Note

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

## See Also

Profiling, `PetscLogGpuFlops()`, `PetscLogEventRegister()`, `PetscLogEventBegin()`, `PetscLogEventEnd()`, `PetscGetFlops()`

## 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