Nature Language: barrierDriver:Driver subroutine for the barrier benchmark.
  
CPP: int barrierDriver(){ \n    repsToDo = defaultReps; \n    barrierKernel(warmUpIters); \n    benchComplete = FALSE; \n    \n    while (benchComplete != TRUE){ \n        MPI_Barrier(comm); \n        startTime = MPI_Wtime(); \n        barrierKernel(repsToDo); \n        MPI_Barrier(comm); \n        finishTime = MPI_Wtime(); \n        totalTime = finishTime - startTime; \n        \n        /* repetitions. */ \n        if (myMPIRank==0){ \n            benchComplete = repTimeCheck(totalTime, repsToDo); \n        } \n        \n        MPI_Bcast(&benchComplete, 1, MPI_INT, 0, comm); \n        MPI_Bcast(&repsToDo, 1, MPI_INT, 0, comm); \n    } \n    \n    if (myMPIRank == 0){ \n        setTestOutcome(TRUE); \n        setReportParams(1,repsToDo,totalTime); \n        printReport(); \n    } \n    \n    return 0; \n}",
  
Fortran: SUBROUTINE barrierDriver()\n\n\t!initialise repsToDo to defaultReps\n\trepsToDo = defaultReps\n\n\t!Perform warm-up for benchmark\n\tCALL barrierKernel(warmUpIters)\n\n\t!Initialise the benchmark \n\tbenchComplete = .false.\n\t!Execute benchmark until target time is reached\n\tDO WHILE (benchComplete .NEQV. .true.)\n\t\t!Start timer\n\t\tCALL MPI_Barrier(comm,ierr)\n\t\tstartTime = MPI_Wtime()\n\t\t\n\t\t!Execute benchmark for repsToDo repetitions\n\t\tCALL barrierKernel(repsToDo)\n\n\t\t!Stop timer \n\t\tCALL MPI_Barrier(comm, ierr)\n\t\tfinishTime = MPI_Wtime()\n\t\ttotalTime = finishTime - startTime\n\n\t\t!Test if target time was reached with number of\n\t\t!repetitions.\n\t\tif (myMPIRank==0) then \n\t\t\tbenchComplete = repTimeCheck(totalTime, repsToDo)\n\t\tend if\n\t\t!Ensure all procs have the same value of benchComplete\n\t\t!and repsToDo\n\t\tcall MPI_Bcast(benchComplete, 1, MPI_INTEGER, 0, comm, ierr)\n\t\tcall MPI_Bcast(repsToDo, 1, MPI_INTEGER, 0, comm, ierr)\n\t\n\tEND DO !End of benchComplete loop\n\n\t!Master process sets benchmark results\n\tIF (myMPIRank == 0) THEN\n\t\t!No unit test, hardwire test result to pass\n\t\tCALL setTestOutcome(.true.)\n\t\tCALL setReportParams(1,repsToDo,totalTime)\n\t\tCALL printReport()\n\tEND IF\n\nEND SUBROUTINE barrierDriver
  