The MPI_Barrier operation performs a synchronization among the processes belonging to the given communicator. That is, all the processes from a given communicator will wait within the MPI_Barrier until all of them are inside, and at that point, they will leave the operation.
int res;
res = MPI_B...