Nature Language: broadcastKernel:The broadcast benchmark. At the start one process owns the data. After, all processes and threads have a copy of the data.
  
CPP: int broadcastKernel(int totalReps, int dataSize){\n    int repIter, i;\n    int startPos;\n\n    for (repIter=0; repIter<totalReps; repIter++){\n        if (myMPIRank == BROADCASTROOT){\n            for (i=0; i<dataSize; i++){\n                broadcastBuf[i] = BROADCASTNUM;\n            }\n        }\n\n        MPI_Bcast(broadcastBuf, dataSize, MPI_INT, BROADCASTROOT, comm);\n\n        #pragma omp parallel default(none) \\\n        private(i,startPos) \\\n        shared(dataSize,finalBroadcastBuf,broadcastBuf)\n        {\n            startPos = ((myThreadID) * dataSize);\n            for (i=0; i<dataSize; i++){\n                finalBroadcastBuf[startPos + i] = broadcastBuf[i];\n            }\n        }\n    }\n\n    return 0;\n}",
  
Fortran: SUBROUTINE broadcastKernel(totalReps, dataSize)\n\tinteger, intent(in) :: totalReps, dataSize\n\tinteger :: repIter, i\n\t!Set source of broadcast\n\tinteger, parameter :: BROADCASTROOT = 0\n\t!Start position in finalBroadcastBuf of each thread.\n\tinteger :: startPos \n\n\tDO repIter = 1, totalReps\n\n\t\t!Master MPI process writes to broadcastBuf\n\t\tIF (myMPIRank == BROADCASTROOT) THEN\n\t\t\tDO i = 1, dataSize\n\t\t\t\tbroadcastBuf(i) = BROADCASTNUM\n\t\t\tEND DO\n\t\tEND IF\n\t\n\t\t!Broadcast array to all other processes.\n\t\tCALL MPI_Bcast(broadcastBuf, dataSize, MPI_INTEGER, &\n\t\t\tBROADCASTROOT, comm, ierr)\n\n\t\t!Each thread copies broadcastBuf to its portion of\n\t\t!finalBroadcastBuf\n\t\t!$OMP PARALLEL DEFAULT(NONE), &\n\t\t!$OMP PRIVATE(i,startPos), &\n\t\t!$OMP SHARED(dataSize,finalBroadcastBuf,broadcastBuf)\n\t\t\n\t\t!Calculate start of each threads portions of finalBroadcastBuf\n\t\tstartPos = ((myThreadID-1) * dataSize)\n\t\tDO i = 1, dataSize\n\t\t\tfinalBroadcastBuf(startPos + i) = broadcastBuf(i)\n\t\tEND DO\n\n\t\t!$OMP END PARALLEL\n\t\n\tEND DO !End of repetitions loop\n\nEND SUBROUTINE broadcastKernel
  