PetscSubcommType — PETSc 3.25.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscSubcommType

How a `PetscSubcomm` is constructed

## Synopsis

    typedef enum {
      PETSC_SUBCOMM_GENERAL    = 0,
      PETSC_SUBCOMM_CONTIGUOUS = 1,
      PETSC_SUBCOMM_INTERLACED = 2
    } PetscSubcommType;

## Values

- `PETSC_SUBCOMM_GENERAL` - similar to `MPI_Comm_split()` each process sets the new communicator (color) they will belong to and the order within that communicator

- `PETSC_SUBCOMM_CONTIGUOUS` - each new communicator contains a set of process with contiguous ranks in the original MPI communicator

- `PETSC_SUBCOMM_INTERLACED` - each new communicator contains a set of processes equally far apart in rank from the others in that new communicator

## Example

Consider a communicator with six processes split into 3 subcommunicators.

       PETSC_SUBCOMM_CONTIGUOUS - the first communicator contains rank 0 and 1, the second rank 2 and 3, and the third rank 4 and 5 in the original ordering of the original communicator
       PETSC_SUBCOMM_INTERLACED - the first communicator contains rank 0 and 3, the second rank 1 and 4, and the third process 2 and 5

## See Also

`PetscSubcommCreate()`, `PetscSubcommSetNumber()`, `PetscSubcommSetType()`, `PetscSubcommView()`, `PetscSubcommSetFromOptions()`

## Level

advanced

## Location

include/petscsystypes.h

## Examples

src/ksp/ksp/tutorials/ex73.c

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages