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: /*@C
  6:     PetscBarrier - Blocks until this routine is executed by all
  7:                    processors owning the object A.

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

 13:   Level: intermediate

 15:   Notes: 
 16:   This routine calls MPI_Barrier with the communicator of the PETSc Object "A". 

 18:    Concepts: barrier

 20: @*/
 21: int PetscBarrier(PetscObject obj)
 22: {
 23:   int      ierr;
 24:   MPI_Comm comm;

 28:   PetscLogEventBegin(Petsc_Barrier,obj,0,0,0);
 29:   if (obj) {
 30:     PetscObjectGetComm(obj,&comm);
 31:   } else {
 32:     comm = PETSC_COMM_WORLD;
 33:   }
 34:   MPI_Barrier(comm);
 35:   PetscLogEventEnd(Petsc_Barrier,obj,0,0,0);
 36:   return(0);
 37: }