petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscCommDuplicate

Duplicates the communicator only if it is not already a PETSc communicator.

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscCommDuplicate(MPI_Comm comm_in,MPI_Comm *comm_out,PetscMPIInt *first_tag)

Collective on MPI_Comm Many br

### Input Parameters

comm_in -Input communicator Many br

### Output Parameters

| comm_out | - Output communicator. May be comm_in. Many br
| first_tag | - Tag available that has not already been used with this communicator (you may Many brpass in NULL if you do not need a tag) Many br

PETSc communicators are just regular MPI communicators that keep track of which Many brtags have been used to prevent tag conflict. If you pass a non-PETSc communicator into Many bra PETSc creation routine it will attach a private communicator for use in the objects communications. Many brThe internal MPI_Comm is used to perform all the MPI calls for PETSc, the outer MPI_Comm is a user Many brlevel MPI_Comm that may be performing communication for the user or other library and so IS NOT used by PETSc. Many br

Many br

### See Also

PetscObjectGetNewTag(), PetscCommGetNewTag(), PetscCommDestroy()

Level:developer
Location:src/sys/objects/tagm.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages