:orphan: # PetscCommGetComm get a new MPI communicator from a PETSc communicator that can be passed off to another package ## Synopsis ``` #include "petscsys.h" PetscErrorCode PetscCommGetComm(MPI_Comm comm_in, MPI_Comm *comm_out) ``` Collective ## Input Parameter - ***comm_in -*** Input communicator ## Output Parameter - ***comm_out -*** Output communicator ## Notes Use `PetscCommRestoreComm()` to return the communicator when the external package no longer needs it Certain MPI implementations have `MPI_Comm_free()` that do not work, thus one can run out of available MPI communicators causing mysterious crashes in the code after running a long time. This routine allows reusing previously obtained MPI communicators that are no longer needed. ## See Also `PetscObjectGetNewTag()`, `PetscCommGetNewTag()`, `PetscCommDestroy()`, `PetscCommRestoreComm()` ## Level developer ## Location src/sys/objects/tagm.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/tagm.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)