I having some synchronization issues using the OpenMPI implementation of MPI_Barrier:
int rank; int nprocs; int rc = MPI_Init(&argc, &argv); if(rc
Adding to the previous answers here, your MPI_BARRIER works fine.
Though, if you just intend to see it working, you can force pause the execution (SLEEP(1)) for a moment to let the output catch up.
SLEEP(1)