Actual source code: pbarrier.c
1: /*$Id: pbarrier.c,v 1.16 2001/03/23 23:20:45 balay Exp $*/
3: #include petsc.h
5: /* Logging support */
6: int PETSC_Barrier;
8: /*@C
9: PetscBarrier - Blocks until this routine is executed by all
10: processors owning the object A.
12: Input Parameters:
13: . A - PETSc object (Mat, Vec, IS, SNES etc...)
14: Must be caste with a (PetscObject), can use PETSC_NULL (for MPI_COMM_WORLD)
16: Level: intermediate
18: Notes:
19: This routine calls MPI_Barrier with the communicator of the PETSc Object "A".
21: Concepts: barrier
23: @*/
24: int PetscBarrier(PetscObject obj)
25: {
26: int ierr;
27: MPI_Comm comm;
31: PetscLogEventBegin(PETSC_Barrier,obj,0,0,0);
32: if (obj) {
33: PetscObjectGetComm(obj,&comm);
34: } else {
35: comm = PETSC_COMM_WORLD;
36: }
37: MPI_Barrier(comm);
38: PetscLogEventEnd(PETSC_Barrier,obj,0,0,0);
39: return(0);
40: }