Date: 2022-03-04T17:37:11+00:00

Actual source code: pbarrier.c

      2: #include <petsc/private/petscimpl.h>

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

      7: /*@C
      8:     PetscBarrier - Blocks until this routine is executed by all
      9:                    processors owning the object obj.

     11:    Input Parameters:
     12: .  obj - PETSc object  (Mat, Vec, IS, SNES etc...)
     13:         The object be caste with a (PetscObject). NULL can be used to indicate the barrier should be across MPI_COMM_WORLD

     15:   Level: intermediate

     17:   Notes:
     18:   This routine calls MPI_Barrier with the communicator of the PETSc Object obj

     20:   Fortran Usage:
     21:     You may pass PETSC_NULL_VEC or any other PETSc null object, such as PETSC_NULL_MAT, to indicate the barrier should be
     22:     across MPI_COMM_WORLD. You can also pass in any PETSc object, Vec, Mat, etc

     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 comm = PETSC_COMM_WORLD;
     36:   MPI_Barrier(comm);
     37:   PetscLogEventEnd(PETSC_Barrier,obj,0,0,0);
     38:   return(0);
     39: }