Changes between Version 71 and Version 72 of Next-GenOpenMPTransformation


Ignore:
Timestamp:
03/17/21 10:45:37 (5 years ago)
Author:
wuwenhao
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Next-GenOpenMPTransformation

    v71 v72  
    4242
    4343{{{
     44void $check_data_race($mem *rs, $mem *ws, int n, int tid) {
     45  $assert(
     46    $forall (int j: 0 .. nthreads - 1) (j != tid) ==>
     47      $mem_disjoint(ws[tid], $mem_union(rs[j], ws[j])) &&
     48      $mem_disjoint(...)
     49  );
     50}
     51}}}
     52{{{
    4453// Init parallel region env.
    4554$range _omp_thread_range = 0 .. _omp_nthreads - 1;
    4655$domain(1) _omp_dom = ($domain){_omp_thread_range};
    4756$omp_gteam _omp_gteam = $omp_gteam_create($here, _omp_nthreads);
     57$mem rs[_omp_nthreads], ws[_omp_nthreads];
     58for(..) {
     59  ws[i] = empty;
     60  rs[i] = empty;
     61}
    4862$for (int _omp_tid: _omp_dom) {
    4963  $depends_on(/*nothing*/)$atomic{
     
    6276      }
    6377      // RS stack: rs0:={A, B}; WS stack: ws0:={A, B};
    64       $check_data_race(); // 1st check
     78      $check_data_race(&rs, &ws, nthreads, tid); // 1st check
    6579      $track_clean();
     80      rs[tid] = $mem_empty();
     81      ws[tid] = $mem_empty();
    6682      // RS stack: rs0:={}; WS stack: ws0:={};
    6783      C;
    68       $check_data_race(); // 2nd check
     84      $check_data_race(&rs, &ws, nthreads, tid); // 2nd check
    6985    } // RS stack: <empty>; WS stack: <empty>; empty sets rs0, ws0;
    7086  } // end $atomic