File1: #include <stdio.h>\n#include <stdlib.h>\n#include <omp.h>\n#define C 100\n\nint *a;\nint *b;\nint *c;\n\nint main(){\n  a = malloc(C*sizeof(int));\n  b = malloc(C*C*sizeof(int));\n  c = malloc(C*sizeof(int));\n\n  for(int i=0; i<C; i++){\n    for(int j=0; j<C; j++){\n      b[j+i*C]=1;\n    }\n    a[i]=1;\n    c[i]=0;\n  }\n\n  #pragma omp target map(to:a[0:C],b[0:C*C]) map(tofrom:c[0:C]) device(0)\n  {\n    #pragma omp teams distribute parallel for\n    for(int i=0; i<C; i++){\n      for(int j=0; j<C; j++){\n        c[i]+=b[j+i*C]*a[j];\n      }\n    }\n  }\n\n  for(int i=0; i<C; i++){\n    if(c[i]!=C){\n      printf("Data Race\n");\n      return 1;\n    }\n  }\n\n  free(a);\n  free(b);\n  free(c);\n\n  return 0;\n}\n
File2: program DRB149_missingdata1_orig_gpu_no\n    use omp_lib\n    implicit none\n\n    integer :: len, i, j\n    integer, dimension(:), allocatable :: a, b, c\n\n    len = 100\n\n    allocate (a(len))\n    allocate (b(len+len*len))\n    allocate (c(len))\n\n    do i = 1, len\n        do j = 1, len\n            b(j+i*len)=1\n        end do\n        a(i) = 1\n        c(i) = 0\n    end do\n\n    !$omp target map(to:a,b) map(tofrom:c) device(0)\n    !$omp teams distribute parallel do\n    do i = 1, len\n        do j = 1, len\n            c(i) = c(i)+a(j)*b(j+i*len)\n        end do\n    end do\n    !$omp end teams distribute parallel do\n    !$omp end target\n\n    do i = 1, len\n        if (c(i)/=len) then\n            print*, c(i)\n        end if\n    end do\n\n    deallocate(a,b,c)\nend program