Nature Language: barrierKernel:Main kernel for barrier benchmark. First threads under each process synchronise with an OMP BARRIER. Then a MPI barrier synchronises each MPI process. MPI barrier is called within a OpenMP master directive.
  
CPP: int barrierKernel(int totalReps){ \n    int repIter; \n\n    #pragma omp parallel default(none) \\ \n    private(repIter) \\ \n    shared(totalReps,comm) \n    { \n        for (repIter=0; repIter<totalReps; repIter++){ \n            #pragma omp barrier \n\n            #pragma omp master \n            { \n                MPI_Barrier(comm); \n            } \n        } \n    } \n\n    return 0; \n}",
  
Fortran: SUBROUTINE barrierKernel(totalReps)\n\tinteger, intent(in) :: totalReps\n\tinteger :: repIter\n\n\t!Open the parallel region\n!$OMP PARALLEL DEFAULT(NONE), &\n!$OMP PRIVATE(repIter), &\n!$OMP SHARED(totalReps,comm,ierr) \n\n\tDO repIter = 1, totalReps\n\n\t\t!Threads synchronise with an OpenMP barrier\n!$OMP BARRIER\n\n\t\t!Master threads on each process now synhronise\n!$OMP MASTER\n\t\tCALL MPI_Barrier(comm, ierr)\n!$OMP END MASTER\n\t\n\tEND DO !End repetitions loop\n\n!$OMP END PARALLEL\n\nEND SUBROUTINE barrierKernel
  