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: #undef __FUNCT__
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: int PetscBarrier(PetscObject obj)
27: {
28: int ierr;
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: }