# PetscShmCommGet
Returns a sub-communicator of all ranks that share a common memory 
## Synopsis
```
#include "petscsys.h"  
PetscErrorCode PetscShmCommGet(MPI_Comm globcomm, PetscShmComm *pshmcomm)
```
Collective.


## Input Parameter

- ***globcomm -*** `MPI_Comm`, which can be a user MPI_Comm or a PETSc inner MPI_Comm



## Output Parameter

- ***pshmcomm -*** the PETSc shared memory communicator object





## Note
When used with MPICH, MPICH must be configured with --download-mpich-device=ch3:nemesis


## See Also
 `PetscShmCommGlobalToLocal()`, `PetscShmCommLocalToGlobal()`, `PetscShmCommGetMpiShmComm()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/mpishm.c.html#PetscShmCommGet">src/sys/utils/mpishm.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/utils/mpishm.c)


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