// Some threads may finish the for loop early and execute errors = dt[9]+1 // while another thread may still be simultaneously executing // the for worksharing region by writing to d[9], // which may cause a data race. // This is a good test for dynamic tools since the data race does not always happen at runtime. // // Liao, source paper: Ma Symbolic Analysis of Concurrency Errors in OpenMP Programs, ICPP 2013 #include #include int main() { int i,error; int len = 1000; int a[1000], b=5; for (i=0; i