File1: #include <stdio.h>\n\n/*\nuse of omp target + teams \nWithout protection, master threads from two teams cause data races.\nData race pair: a@66:5:W vs. a@66:5:W\n*/\nint main(int argc, char* argv[])\n{\n  int i;\n  int len = 100;\n  double a[len];\n\n  /*Initialize with some values*/\n  for (i=0; i<len; i++)\n    a[i]= ((double)i)/2.0;\n\n#pragma omp target map(tofrom: a[0:len]) \n#pragma omp teams num_teams(2) \n  {\n    a[50]*=2.0;\n  }\n\n  printf ("a[50]=%f\n", a[50]);\n  return 0;\n}\n
File2: program DRB116_target_teams_orig_yes\n    use omp_lib\n    implicit none\n\n    integer i, len\n    integer, parameter :: dp = kind(1.0d0)\n    real(dp), dimension(:), allocatable :: a\n\n    len = 100\n    allocate (a(len))\n\n    do i = 1, len\n        a(i) = (real(i,dp))/2.0\n    end do\n\n    !$omp target map(tofrom: a(0:len))\n        !$omp teams num_teams(2)\n        a(50) = a(50)*2.0\n        !$omp end teams\n    !$omp end target\n\n    print*,'a(50)=',a(50)\n\n    deallocate(a)\nend program