Actual source code: pbarrier.c

      1: #define PETSC_DLL

     3:  #include petsc.h

      5: /* Logging support */
      6: PetscEvent PETSC_Barrier = 0;

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

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

     18:   Level: intermediate

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

     23:    Concepts: barrier

     25: @*/
     26: PetscErrorCode PETSC_DLLEXPORT PetscBarrier(PetscObject obj)
     27: {
     29:   MPI_Comm comm;

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