# PCMGSetNumberSmooth
Sets the number of pre and post-smoothing steps to use on all levels.  Use `PCMGDistinctSmoothUp()` to create separate up and down smoothers if you want different numbers of pre- and post-smoothing steps. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCMGSetNumberSmooth(PC pc, PetscInt n)
```
Logically Collective


## Input Parameters

- ***mg -*** the multigrid context
- ***n -*** the number of smoothing steps



## Options Database Key

- ***-mg_levels_ksp_max_it <n> -*** Sets number of pre and post-smoothing steps





## Note
This does not set a value on the coarsest grid, since we assume that there is no separate smooth up on the coarsest grid.


## See Also
 `PCMG`, `PCMGSetDistinctSmoothUp()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mg/mg.c.html#PCMGSetNumberSmooth">src/ksp/pc/impls/mg/mg.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex35.cxx.html">src/ksp/ksp/tutorials/ex35.cxx.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex36.cxx.html">src/ksp/ksp/tutorials/ex36.cxx.html</A><BR>


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


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