# KSPSetCheckNormIteration
Sets the first iteration at which the norm of the residual will be computed and used in the convergence test. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPSetCheckNormIteration(KSP ksp, PetscInt it)
```
Logically Collective


## Input Parameters

- ***ksp -*** Krylov solver context
- ***it  -*** use -1 to check at all iterations



## Notes
Currently only works with `KSPCG`, `KSPBCGS` and `KSPIBCGS`

Use `KSPSetNormType`(ksp,`KSP_NORM_NONE`) to never check the norm

On steps where the norm is not computed, the previous norm is still in the variable, so if you run with, for example,
-ksp_monitor the residual norm will appear to be unchanged for several iterations (though it is not really unchanged).



## See Also
 `KSP`, `KSPSetUp()`, `KSPSolve()`, `KSPDestroy()`, `KSPConvergedSkip()`, `KSPSetNormType()`

## Level
advanced

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/itcreate.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)  
