PetscStack#

Fixed-size record of the chain of PETSc functions that are currently active on the calling thread; maintained by PetscFunctionBegin/PetscFunctionReturn to provide meaningful PETSc-level back traces and to drive the SAWs stack viewer

Synopsis#

typedef struct {
  const char *function[PETSCSTACKSIZE];
  const char *file[PETSCSTACKSIZE];
  int         line[PETSCSTACKSIZE];
  int         petscroutine[PETSCSTACKSIZE]; /* 0 external called from PETSc, 1 PETSc functions, 2 PETSc user functions */
  int         currentsize;
  int         hotdepth;
  PetscBool   check; /* option to check for correct Push/Pop semantics, true for default petscstack but not other stacks */
} PetscStack;

Notes#

The global stack petscstack is maintained only when PETSc is configured --with-debugging and without thread safety; in other configurations the stack-manipulation macros become no-ops. Inspect a stack with PetscStackView() or PetscStackViewSAWs().

The depth is bounded by PETSCSTACKSIZE; deeper call chains silently saturate at that depth

See Also#

PetscFunctionBegin, PetscFunctionBeginUser, PetscFunctionReturn(), PetscStackView(), PetscStackViewSAWs(), PetscMallocGetStack()

Level#

developer

Location#

include/petscerror.h


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