# KSPSetLagNorm
Lags the residual norm calculation so that it is computed as part of the `MPI_Allreduce()` for computing the inner products for the next iteration.  This can reduce communication costs at the expense of doing one additional iteration. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPSetLagNorm(KSP ksp, PetscBool flg)
```
Logically Collective on ksp


## Input Parameters

- ***ksp -*** Krylov solver context
- ***flg -*** `PETSC_TRUE` or `PETSC_FALSE`



## Options Database Keys

- ***-ksp_lag_norm -*** lag the calculated residual norm





## Notes
Currently only works with `KSPIBCGS`.

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

If you lag the norm and run with, for example, -ksp_monitor, the residual norm reported will be the lagged one.


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

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/interface/itcreate.c.html#KSPSetLagNorm">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)  
