added sense reversing barrier for both MPI and OpenMP