Skip to main content
`Ctrl`+`K`

# petsc4py.PETSc.Comm

class petsc4py.PETSc.Comm

  Bases: `object`

  Communicator object.

  Predefined instances:

  `COMM_NULL`

    The null (or invalid) communicator.

  `COMM_SELF`

    The self communicator.

  `COMM_WORLD`

    The world communicator.

  See also

  `Sys.setDefaultComm`, `Sys.getDefaultComm`

  Methods Summary

  `barrier`() | Barrier synchronization.
  `destroy`() | Destroy the communicator.
  `duplicate`() | Duplicate the communicator.
  `getRank`() | Return the rank of the calling processes in the communicator.
  `getSize`() | Return the number of processes in the communicator.
  `tompi4py`() | Convert communicator to `mpi4py`.

  Attributes Summary

  `fortran` | Fortran handle.
  `rank` | Communicator rank.
  `size` | Communicator size.

  Methods Documentation

  barrier()

    Barrier synchronization.

    Collective.

    Source code at petsc4py/PETSc/Comm.pyx:123

    Return type:

      None

  destroy()

    Destroy the communicator.

    Collective.

    See also

    `PetscCommDestroy`

    Source code at petsc4py/PETSc/Comm.pyx:61

    Return type:

      None

  duplicate()

    Duplicate the communicator.

    Collective.

    See also

    `PetscCommDuplicate`

    Source code at petsc4py/PETSc/Comm.pyx:79

    Return type:

      Self

  getRank()

    Return the rank of the calling processes in the communicator.

    Not collective.

    Source code at petsc4py/PETSc/Comm.pyx:111

    Return type:

      int

  getSize()

    Return the number of processes in the communicator.

    Not collective.

    Source code at petsc4py/PETSc/Comm.pyx:99

    Return type:

      int

  tompi4py()

    Convert communicator to `mpi4py`.

    Not collective.

    See also

    `mpi4py.MPI.Comm`, `mpi4py.MPI.Intracomm`

    Source code at petsc4py/PETSc/Comm.pyx:155

    Return type:

      Intracomm

  Attributes Documentation

  fortran

    Fortran handle.

    Source code at petsc4py/PETSc/Comm.pyx:147

  rank

    Communicator rank.

    Source code at petsc4py/PETSc/Comm.pyx:140

  size

    Communicator size.

    Source code at petsc4py/PETSc/Comm.pyx:135

  __init__()
  classmethod __new__(*args, **kwargs)