:orphan:
# TSSetMaxSNESFailures
Sets the maximum number of failed `SNES` solves 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSSetMaxSNESFailures(TS ts, PetscInt fails)
```
Not Collective


## Input Parameters

- ***ts -*** `TS` context
- ***fails -*** maximum number of failed nonlinear solves, pass -1 for unlimited



## Options Database Key

- ***-ts_max_snes_failures -*** Maximum number of nonlinear solve failures





## See Also
 [](ch_ts), `TS`, `SNES`, `TSGetSNESIterations()`, `TSGetKSPIterations()`, `TSSetMaxStepRejections()`, `TSGetStepRejections()`, `TSGetSNESFailures()`, `SNESGetConvergedReason()`, `TSGetConvergedReason()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/ts.c.html#TSSetMaxSNESFailures">src/ts/interface/ts.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex8.c.html">src/ts/tutorials/ex8.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/extchem.c.html">src/ts/tutorials/extchem.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/extchemfield.c.html">src/ts/tutorials/extchemfield.c</A><BR>


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


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