PetscLogHandlerGetNumObjects — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscLogHandlerGetNumObjects

Get the number of objects that were logged with a log handler

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscLogHandlerGetNumObjects(PetscLogHandler handler, PetscInt *num_objects)

Not Collective

## Input Parameter

- handler - a `PetscLogHandler`

## Output Parameter

- num_objects - the number of objects whose creations and destructions were logged with `handler` (`PetscLogHandlerObjectCreate()` / `PetscLogHandlerObjectDestroy()`), or -1 if the handler does not keep track of this number.

## Note

The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not.

## See Also

Profiling

## Level

developer

## Location

src/sys/logging/handler/interface/loghandler.c

## Implementations

PetscLogHandlerGetNumObjects_Default() in src/sys/logging/handler/impls/default/logdefault.c

Index of all Profiling routines
Table of Contents for all manual pages
Index of all manual pages