Skip to main content
Ctrl+K
PETSc 3.22.5 documentation - Home
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • PetscObjectGetComm

PetscObjectGetComm#

Gets the MPI communicator for any PetscObject regardless of the type.

Synopsis#

#include "petscsys.h"    
PetscErrorCode PetscObjectGetComm(PetscObject obj, MPI_Comm *comm)

Not Collective

Input Parameter#

  • obj - any PETSc object, for example a Vec, Mat or KSP. It must be cast with a (PetscObject), for example, PetscObjectGetComm((PetscObject)mat,&comm);

Output Parameter#

  • comm - the MPI communicator

See Also#

PetscObject, PetscObjectComm()

Level#

advanced

Location#

src/sys/objects/gcomm.c

Examples#

src/snes/tutorials/ex26.c
src/ksp/ksp/tutorials/ex55.c
src/snes/tutorials/ex48.c
src/dm/tutorials/ex15.c
src/ksp/ksp/tutorials/ex73.c
src/ksp/ksp/tutorials/ex42.c
src/snes/tutorials/ex13.c
src/snes/tutorials/ex27.c
src/dm/impls/plex/tutorials/ex11.c
src/snes/tutorials/ex30.c


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

On this page
  • Synopsis
  • Input Parameter
  • Output Parameter
  • See Also
  • Level
  • Location
  • Examples
Edit on GitLab
Show Source

© Copyright 1991-2025, UChicago Argonne, LLC and the PETSc Development Team.

Created using Sphinx 7.3.7.

Built with the PyData Sphinx Theme 0.15.1.

Last updated on 2025-03-28T16:05:55-0500 (v3.22.5).