PetscStackView#

Print the calling thread’s default PETSc stack to an ASCII file

Synopsis#

#include "petscsys.h"   
PetscErrorCode PetscStackView(FILE *file)

Not Collective, No Fortran Support

Input Parameter#

  • file - the file pointer, or NULL to use PETSC_STDERR

Notes#

In debug mode PETSc maintains a stack of the current function calls that can be used to help to quickly see where a problem has occurred, for example, when a signal is received. It is recommended to use the debugger if extensive information is needed to help debug the problem.

If file is PETSC_STDERR (or NULL) then PetscErrorPrintf() is used to print the stack, otherwise fprintf() is used.

The stack is maintained only when PETSc is configured --with-debugging; otherwise this becomes a no-op that returns PETSC_SUCCESS.

Developer Note#

The default stack is a global variable called petscstack. With thread safety enabled, this variable has a separate instance for each thread.

See Also#

PetscAttachDebugger(), PetscStackCopy(), PetscStackPrint(), PetscStackSAWsGrantAccess(), PetscStackSAWsTakeAccess()

Level#

developer

Location#

src/sys/error/pstack.c

Examples#

src/sys/tests/ex33.c


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