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: With fortran Use PETSC_NULL_OBJECT (instead of PETSC_NULL) 25: Concepts: barrier 27: @*/ 28: PetscErrorCode PetscBarrier(PetscObject obj) 29: { 31: MPI_Comm comm; 36: if (obj) { 37: PetscObjectGetComm(obj,&comm); 38: } else { 39: comm = PETSC_COMM_WORLD; 40: } 41: MPI_Barrier(comm); 43: return(0); 44: }