# PetscStackPushExternal
Pushes a new function name onto the PETSc default stack that tracks where the running program is currently in the source code. Does not include the filename or line number since this is called by the calling routine for non-PETSc or user functions. Not Collective


## Synopsis
```
#include <petscsys.h>
void PetscStackPushExternal(char *funct);
```

## Input Parameters

- ***funct -*** the function name





## Notes
Using `PetscCallExternal()` and friends automatically handles this process

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.

The default stack is a global variable called `petscstack`.

This is to be used when calling an external package function such as a BLAS function.

This also updates the stack line number for the current stack function.


## See Also
 `PetscAttachDebugger()`, `PetscStackCopy()`, `PetscStackView()`, `PetscStackPopNoCheck()`, `PetscCall()`, `PetscFunctionBegin()`,
`PetscFunctionReturn()`, `PetscFunctionBeginHot()`, `PetscFunctionBeginUser()`, `PetscStackPushNoCheck()`, `PetscStackPop`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscerror.h.html#PetscStackPushExternal">include/petscerror.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscerror.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
