Purpose:
Blocks the calling process until all group members have called the routine
Fortran Binding:
MPI_BARRIER (comm, ierr)
C Binding:
MPI_Barrier (MPI_comm comm)
In parallel applications in the distributed memory environment, explicit or implicit synchronization is sometimes required. As with other message-passing libraries, MPI provides a function call, MPI_BARRIER, to synchronize all processes within a communicator. A barrier is simply a synchronization primitive. A node calling it will be blocked until all the nodes within the group have called it. The syntax of MPI_BARRIER for both C and FORTRAN programs is given below:
C
| MPI_Barrier |
(MPI_Comm comm) |
where:
| MPI_Comm |
is an MPI predefined structure for communicators, and |
| comm |
is a communicator. |
FORTRAN
where:
| comm |
is an integer denoting a communicator |
| ierr |
is an integer return error code. |