# DMStagGetNumRanks
get number of ranks in each direction in the global grid decomposition 
## Synopsis
```
PetscErrorCode DMStagGetNumRanks(DM dm, PetscInt *nRanks0, PetscInt *nRanks1, PetscInt *nRanks2)
```
Not Collective


## Input Parameter

- ***dm -*** the `DMSTAG` object



## Output Parameters

- ***nRanks0 -*** number of ranks in the x direction in the grid decomposition
- ***nRanks1 -*** number of ranks in the y direction in the grid decomposition
- ***nRanks2 -*** number of ranks in the z direction in the grid decomposition





## See Also
 [](chapter_stag), `DMSTAG`, `DMStagGetGlobalSizes()`, `DMStagGetLocalSize()`, `DMStagSetNumRanks()`, `DMDAGetInfo()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/stagutils.c.html#DMStagGetNumRanks">src/dm/impls/stag/stagutils.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/stag/stagutils.c)


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