# PCMGGetLevels
Gets the number of levels to use with `PCMG`. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCMGGetLevels(PC pc, PetscInt *levels)
```
Not Collective


## Input Parameter

- ***pc -*** the preconditioner context



## Output parameter

- ***levels -*** the number of levels





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

## Level
advanced

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mg/mg.c.html#PCMGGetLevels_MG">PCMGGetLevels_MG in src/ksp/pc/impls/mg/mg.c</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)  
