File1: #include <stdio.h>\n#include <omp.h>\n\nint main(){\n  int a, i;\n\n  #pragma omp parallel shared(a) private(i)\n  {\n    #pragma omp master\n    a = 0;\n\n    #pragma omp barrier\n\n    #pragma omp for reduction(+:a)\n    for (i=0; i<10; i++){\n      a += i;\n    }\n\n    #pragma omp single\n    printf("Sum is %d\n", a);\n  }\n\n  return 0;\n}\n
File2: program DRB141_reduction_barrier_orig_no\n    use omp_lib\n    implicit none\n\n    integer :: a, i\n\n    !$omp parallel shared(a) private(i)\n        !$omp master\n        a = 0\n        !$omp end master\n        \n        !$omp barrier        \n\n        !$omp do reduction(+:a)\n        do i = 1, 10\n            a = a+i\n        end do\n        !$omp end do\n\n        !$omp single\n        print*, "Sum is ", A\n        !$omp end single\n\n    !$omp end parallel\nend program