Changes between Version 18 and Version 19 of OpenMPTransformation
- Timestamp:
- 04/20/14 21:28:39 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OpenMPTransformation
v18 v19 120 120 * else: some other thread has some write to the variable which it hasn't flushed. Not exactly sure what is supposed to happen, but I think this is like a race condition 121 121 122 Function 123 {{{ 124 barrier_and_flush(); 125 }}} 126 does a barrier on `_barrier` and a flush on all shared variables. 127 122 128 === Translating `parallel` === 123 129 … … 137 143 $omp_gws _gws = $omp_gws_create($here, _nthreads); 138 144 $gbarrier _gbarrier = $gbarrier_create($here, _nthreads); 145 // declare shared variables and corresponding state variables 146 // initialize all state components to -1 139 147 void _thread(int _tid) { 140 148 $omp_ws _ws = $omp_ws_create($here, _gws, _tid); … … 176 184 translate(S); 177 185 } 178 $barrier_call(_barrier);186 barrier_and_flush(); 179 187 } 180 188 }}} … … 216 224 } /* end of switch */ 217 225 } /* end of while loop */ 218 $barrier_call(_barrier);226 barrier_and_flush(); 219 227 } 220 228 }}} … … 235 243 translate(S); 236 244 } 237 $barrier_call(_barrier);245 barrier_and_flush(); 238 246 }}} 239 247 … … 250 258 {{{ 251 259 $omp_barrier_arrive(_ws, 58); 252 $barrier_call(_barrier);260 barrier_and_flush(); 253 261 }}} 254 262
