Actual source code: pbarrier.c

petsc-master 2014-12-24
Report Typos and Errors
  2: #include <petsc-private/petscimpl.h>              /*I "petscsys.h" I*/

  4: /* Logging support */
  5: PetscLogEvent PETSC_Barrier=0;

  9: /*@C
 10:     PetscBarrier - Blocks until this routine is executed by all
 11:                    processors owning the object A.

 13:    Input Parameters:
 14: .  A - PETSc object  (Mat, Vec, IS, SNES etc...)
 15:         Must be caste with a (PetscObject), can use NULL (for MPI_COMM_WORLD)

 17:   Level: intermediate

 19:   Notes:
 20:   This routine calls MPI_Barrier with the communicator of the PETSc Object "A".

 22:   With fortran Use NULL_OBJECT (instead of NULL)

 24:    Concepts: barrier

 26: @*/
 27: PetscErrorCode  PetscBarrier(PetscObject obj)
 28: {
 30:   MPI_Comm       comm;

 34:   PetscLogEventBegin(PETSC_Barrier,obj,0,0,0);
 35:   if (obj) {
 36:     PetscObjectGetComm(obj,&comm);
 37:   } else comm = PETSC_COMM_WORLD;
 38:   MPI_Barrier(comm);
 39:   PetscLogEventEnd(PETSC_Barrier,obj,0,0,0);
 40:   return(0);
 41: }