MPI_BARRIER blocks the caller until all group members have called it. The call returns at an process only after all group members have entered the call.
MPI_BARRIER
MPI_BARRIER( comm ) [ IN comm] communicator (handle) Code int MPI_Barrier(MPI_Comm comm )