Actual source code: pbarrier.c

 2:  #include petsc.h

  4: /* Logging support */
  5: PetscEvent 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 PETSC_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:    Concepts: barrier

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

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