:orphan:
# PetscOmpCtrlGetOmpComms
Get MPI communicators from a PETSc OMP controller 
## Synopsis
```
#include "petscsys.h"  
PetscErrorCode PetscOmpCtrlGetOmpComms(PetscOmpCtrl ctrl, MPI_Comm *omp_comm, MPI_Comm *omp_master_comm, PetscBool *is_omp_master)
```

## Input Parameter

- ***ctrl -*** a PETSc OMP controller



## Output Parameters

- ***omp_comm         -*** a communicator that includes a master rank and slave ranks where master spawns threads
- ***omp_master_comm  -*** on master ranks, return a communicator that include master ranks of each omp_comm;
on slave ranks, `MPI_COMM_NULL` will be return in reality.
- ***is_omp_master    -*** true if the calling process is an OMP master rank.



## Note
Any output parameter can be NULL. The parameter is just ignored.




## See Also
 `PetscOmpCtrlCreate()`, `PetscOmpCtrlDestroy()`, `PetscOmpCtrlBarrier()`, `PetscOmpCtrlOmpRegionOnMasterBegin()`, `PetscOmpCtrlOmpRegionOnMasterEnd()`,

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/mpishm.c.html#PetscOmpCtrlGetOmpComms">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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
