Purpose
Blocks each task until all tasks have called it.
C synopsis
#include <mpi.h> int MPI_Barrier(MPI_Comm comm);
C++ synopsis
#include mpi.h void MPI::Comm::Barrier() const;
FORTRAN synopsis
include 'mpif.h' or use mpi MPI_BARRIER(INTEGER COMM,INTEGER IERROR)
Parameters
Description
This subroutine blocks until all tasks have called it. Tasks cannot exit the operation until all group members have entered.
When you use this subroutine in a threads application, make sure all collective operations on a particular communicator occur in the same order at each task. See IBM Parallel Environment for AIX: MPI Programming Guide for more information on programming with MPI in a threads environment.
Notes
comm can be an intercommunicator or an intracommunicator. If comm is an intercommunicator, the barrier is performed across all tasks in the intercommunicator. In this case, all tasks in the local group of the intercommunicator can exit the barrier when all of the tasks in the remote group have entered the barrier.
Errors
Fatal errors:
Related information