Changes between Version 62 and Version 63 of Next-GenOpenMPTransformation


Ignore:
Timestamp:
11/21/19 16:00:59 (6 years ago)
Author:
wuwenhao
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Next-GenOpenMPTransformation

    v62 v63  
    9898
    9999== OpenMP Types ==
    100 * `omp_lock_t` ([https://vsl.cis.udel.edu/trac/civl/browser/CIVL/trunk/src/include/civl/omp.cvl omp.cvl])
     100* `omp_lock_t`
    101101
    102102== OpenMP Runtime Library Routines ==
     
    905905
    906906([https://vsl.cis.udel.edu/trac/civl/wiki/Next-GenOpenMPTransformation#OpenMPConstructs back to top])
     907
     908== Translations of specific routines ==
     909
     910=== Lock Routines ===
     911==== OpenMP Simple Lock ====
     912
     913* `omp_lock_t`, `omp_init_lock` and `omp_destroy_lock` stay unchanged ([https://vsl.cis.udel.edu/trac/civl/browser/CIVL/trunk/src/include/civl/omp.cvl omp.cvl])
     914* `omp_set_lock` and `omp_unset_lock` are translated as:
     915
     916{{{
     917  ..
     918  omp_set_lock(&lck);
     919  BLOCK;
     920  omp_unset_lock(&lck);
     921  ..
     922}}}
     923
     924=>
     925
     926{{{
     927  ..
     928  $read_and_write_set_update(team);
     929  $yield();
     930  $omp_set_lock(&lck, tid);
     931  $check_data_race(team);
     932
     933  translated(BLOCK);
     934
     935  $read_and_write_set_update(team);
     936  $yield();
     937  $omp_unset_lock(&lck, tid);
     938  $check_data_race(team);
     939  ..
     940}}}
     941
     942* `omp_test_lock` is translated as:
     943
     944{{{
     945  while(! omp_test_lock(&lck)) {
     946    .. // Other non-critical task
     947  }
     948  .. // Critical task
     949  omp_unset_lock(&lck);
     950}}}
     951
     952=>
     953
     954{{{
     955  while(! omp_test_lock(&lck, tid)) { // no Sync, not wrapped
     956    .. // Other non-critical task
     957  }
     958  .. // Critical task
     959  $read_and_write_set_update(team);
     960  $yield();
     961  $omp_unset_lock(&lck, tid); // Sync required, so wrapped.
     962  $check_data_race(team);
     963}}}
     964
     965([https://vsl.cis.udel.edu/trac/civl/wiki/Next-GenOpenMPTransformation#OpenMPConstructs back to top])