| 196 | | * OpenMP2CIVL Transformer will transform this program to a equivalent CIVL-C program for model checking |
| | 196 | * OpenMP2CIVL Transformer will transform this program to a equivalent CIVL-C program for model checking. Here is the code snippet for the CIVL-C program after transformation: |
| | 197 | {{{ |
| | 198 | int main() { |
| | 199 | int a[10]; |
| | 200 | { |
| | 201 | { |
| | 202 | int _elab_i = 0; |
| | 203 | for (; _elab_i < _omp_num_threads; _elab_i = _elab_i + 1) |
| | 204 | ; |
| | 205 | } |
| | 206 | int $sef$0 = $choose_int(_omp_num_threads); |
| | 207 | int _omp_nthreads = 1 + $sef$0; |
| | 208 | $range _omp_thread_range = 0 .. _omp_nthreads - 1; |
| | 209 | $domain(1) _omp_dom = ($domain){_omp_thread_range}; |
| | 210 | $omp_gteam _omp_gteam = $omp_gteam_create($here, _omp_nthreads); |
| | 211 | $omp_gshared _omp_a_gshared = $omp_gshared_create(_omp_gteam, &(a)); |
| | 212 | $parfor (int _omp_tid: _omp_dom) { |
| | 213 | $omp_team _omp_team = $omp_team_create($here, _omp_gteam, _omp_tid); |
| | 214 | int _omp_a_local[10]; |
| | 215 | int _omp_a_status[10]; |
| | 216 | $omp_shared _omp_a_shared = $omp_shared_create(_omp_team, _omp_a_gshared, &(_omp_a_local), &(_omp_a_status)); |
| | 217 | { |
| | 218 | $range _omp_r1 = 1 .. 10 - 1 # 1; |
| | 219 | $domain(1) _omp_loop_domain = ($domain){_omp_r1}; |
| | 220 | $domain $sef$1 = $omp_arrive_loop(_omp_team, 0, ($domain)_omp_loop_domain, 2); |
| | 221 | $domain(1) _omp_my_iters = ($domain(1))$sef$1; |
| | 222 | $for (int _omp_i_private: _omp_my_iters) { |
| | 223 | int c; |
| | 224 | c = _omp_i_private % 2; |
| | 225 | int _omp_write0; |
| | 226 | _omp_write0 = 0; |
| | 227 | $omp_write(_omp_a_shared, &(_omp_a_local[c]), &(_omp_write0)); |
| | 228 | } |
| | 229 | } |
| | 230 | $omp_barrier_and_flush(_omp_team); |
| | 231 | $omp_shared_destroy(_omp_a_shared); |
| | 232 | $omp_team_destroy(_omp_team); |
| | 233 | } |
| | 234 | $omp_gshared_destroy(_omp_a_gshared); |
| | 235 | $omp_gteam_destroy(_omp_gteam); |
| | 236 | } |
| | 237 | } |
| | 238 | }}} |