cpp: #include <stdio.h>\n/*\n *  loop missing the linear clause\n *  Data race pairs (race on j allows wrong indexing of c):  \n     j@70:7:R vs. j@71:5:W\n     j@71:5:W vs. j@71:5:W \n     c[j]@70:5:W vs. c[j]@70:5:W\n*/\nint main()\n{\n  int len=100;\n  double a[len], b[len], c[len];\n  int i,j=0;\n\n  for (i=0;i<len;i++)\n  {\n    a[i]=((double)i)/2.0; \n    b[i]=((double)i)/3.0; \n    c[i]=((double)i)/7.0; \n  }\n\n#pragma omp parallel for \n  for (i=0;i<len;i++)\n  {\n    c[j]+=a[i]*b[i];\n    j++;\n  }\n\n  printf ("c[50]=%f\n",c[50]);\n  return 0;\n}\n
fortran: program DRB111_linearmissing_orig_yes\n    use omp_lib\n    implicit none\n\n    integer len, i, j\n    integer, parameter :: dp = kind(1.0d0)\n    real(dp), dimension(:), allocatable :: a,b,c\n\n    len = 100\n    i = 0\n    j = 0\n\n    allocate (a(len))\n    allocate (b(len))\n    allocate (c(len))\n\n    do i = 1, len\n        a(i) = (real(i,dp))/2.0\n        b(i) = (real(i,dp))/3.0\n        c(i) = (real(i,dp))/7.0\n    end do\n\n    !$omp parallel do\n    do i = 1, len\n        c(j) = c(j)+a(i)*b(i)\n        j = j+1\n    end do\n    !$omp end parallel do\n\n    print*,'c(50) =',c(50)\n\n    if(allocated(a))deallocate(a)\n    if(allocated(b))deallocate(b)\n   \nend program