# PetscOptionsPushGetViewerOff
sets if a `PetscOptionsGetViewer()` returns a viewer. 
## Synopsis
```
#include "petscviewer.h" 
PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool flg)
```
Logically Collective


## Input Parameter

- ***flg -*** `PETSC_TRUE` to turn off viewer creation, `PETSC_FALSE` to turn it on.





## Note
Calling XXXViewFromOptions in an inner loop can be very expensive.  This can appear, for example, when using
many small subsolves.  Call this function to control viewer creation in `PetscOptionsGetViewer()`, thus removing the expensive XXXViewFromOptions calls.


## See Also
 `PetscOptionsGetViewer()`, `PetscOptionsPopGetViewerOff()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/interface/viewreg.c.html#PetscOptionsPushGetViewerOff">src/sys/classes/viewer/interface/viewreg.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/interface/viewreg.c)


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