The test had a chance to finish the first task before the second task is
created. In this case, the dependences-pair event would not trigger.
int main() {
int x = 0;
+ int condition=0;
#pragma omp parallel num_threads(2)
{
#pragma omp master
print_ids(0);
printf("%" PRIu64 ": address of x: %p\n", ompt_get_thread_data()->value,
&x);
-#pragma omp task depend(out : x)
+#pragma omp task depend(out : x) shared(condition)
{
x++;
- delay(100);
+ OMPT_WAIT(condition,1);
}
print_fuzzy_address(1);
print_ids(0);
#pragma omp task depend(in : x)
{ x = -1; }
print_ids(0);
+ OMPT_SIGNAL(condition);
}
}