# KSPGMRESSetRestart
Sets number of iterations at which `KSPGMRES`, `KSPFGMRES` and `KSPLGMRES` restarts. 
## Synopsis
```
#include "petscksp.h"  
PetscErrorCode KSPGMRESSetRestart(KSP ksp, PetscInt restart)
```
Logically Collective on ksp


## Input Parameters

- ***ksp -*** the Krylov space context
- ***restart -*** integer restart value



## Options Database Key

- ***-ksp_gmres_restart <positive integer> -*** integer restart value





## Note
The default value is 30.


## See Also
 [](chapter_ksp), `KSPGMRES`, `KSPSetTolerances()`, `KSPGMRESSetOrthogonalization()`, `KSPGMRESSetPreAllocateVectors()`, `KSPGMRESGetRestart()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/gmres.c.html#KSPGMRESSetRestart">src/ksp/ksp/impls/gmres/gmres.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex71.c.html">src/ksp/ksp/tutorials/ex71.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/fgmres/fgmres.c.html#KSPGMRESSetRestart_FGMRES">KSPGMRESSetRestart_FGMRES in src/ksp/ksp/impls/gmres/fgmres/fgmres.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/gmres.c.html#KSPGMRESSetRestart_GMRES">KSPGMRESSetRestart_GMRES in src/ksp/ksp/impls/gmres/gmres.c</A><BR>


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