# PetscStageLogPush
This function pushes a stage on the stack. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscStageLogPush(PetscStageLog stageLog, int stage)
```
Not Collective


## Input Parameters

- ***stageLog   -*** The `PetscStageLog`
- ***stage -*** The stage to log



## Database Options

- ***-log_view -*** Activates logging



## Usage
If the option -log_view is used to run the program containing the
following code, then 2 sets of summary data will be printed during
`PetscFinalize()`.
```none
      PetscInitialize(int *argc,char ***args,0,0);
      [stage 0 of code]
      PetscStageLogPush(stageLog,1);
      [stage 1 of code]
      PetscStageLogPop(stageLog);
      PetscBarrier(...);
      [more stage 0 of code]
      PetscFinalize();
```


Note;
Use `PetscLogStageRegister()` to register a stage. All previous stages are
accumulating time and flops, but events will only be logged in this stage.




## See Also
 `PetscStageLogPop()`, `PetscStageLogGetCurrent()`, `PetscStageLogRegister()`, `PetscLogGetStageLog()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/logging/utils/stagelog.c.html#PetscStageLogPush">src/sys/logging/utils/stagelog.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/logging/utils/stagelog.c)


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