# KSPMonitor
runs the user provided monitor routines, if they exist 
## Synopsis
```
#include "petscksp.h" 
#include "petscmat.h" 
PetscErrorCode KSPMonitor(KSP ksp, PetscInt it, PetscReal rnorm)
```
Collective


## Input Parameters

- ***ksp -*** iterative context obtained from `KSPCreate()`
- ***it -*** iteration number
- ***rnorm -*** relative norm of the residual



## Notes
This routine is called by the `KSP` implementations.
It does not typically need to be called by the user.




## See Also
 [](chapter_ksp), `KSPMonitorSet()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/interface/itfunc.c.html#KSPMonitor">src/ksp/ksp/interface/itfunc.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/fetidp/fetidp.c.html#KSPMonitor_FETIDP">KSPMonitor_FETIDP in src/ksp/ksp/impls/fetidp/fetidp.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/itfunc.c)


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