Wait until all processes in the communicator have reached the same barrier.

Namespace:  MPI
Assembly:  MPI (in MPI.dll)
Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public void Barrier()
Visual Basic (Declaration)
Public Sub Barrier
Visual C++
public:
void Barrier()

Remarks

This collective operation should be called by all processes within the communicator. Each process will wait within the barrier until all processes have entered the barrier, at which point all of the processes will be released. Use barriers when all of the processes need to synchronize at some particular point in your program flow.

Examples

Barriers are often used after each process has completed some large, independent chunk of work:
CopyC#
public void Superstep(Communicator comm) 
{
  // Perform a large chunk of work  locally
  DoLocalWork();

  // Synchronize with everyone else
  comm.Barrier();

  // Okay, move on to the next piece of work.
}

See Also