32 int th = omp_get_thread_num();
35 printf(
"task %d, th %d\n", task_id, th);
38 printf(
"Error1, checker %d != 1\n",
checker);
43 printf(
"Error2, checker %d != 1\n",
checker);
56 #pragma omp single nowait
58 int t = omp_get_thread_num();
59 #pragma omp task depend(in: i1, i2)
60 {
int th = omp_get_thread_num();
61 printf(
"task 0_%d, th %d\n", t, th);
63 #pragma omp task depend(in: i1, i3)
64 {
int th = omp_get_thread_num();
65 printf(
"task 1_%d, th %d\n", t, th);
67 #pragma omp task depend(in: i2) depend(out: i1)
68 {
int th = omp_get_thread_num();
69 printf(
"task 2_%d, th %d\n", t, th);
71 #pragma omp task depend(in: i1)
72 {
int th = omp_get_thread_num();
73 printf(
"task 3_%d, th %d\n", t, th);
75 #pragma omp task depend(out: i2)
76 {
int th = omp_get_thread_num();
77 printf(
"task 4_%d, th %d\n", t, th);
79 #pragma omp task depend(out: i3)
80 {
int th = omp_get_thread_num();
81 printf(
"task 5_%d, th %d\n", t, th);
84 #pragma omp task depend(mutexinoutset: i1, i4)
86 #pragma omp task depend(mutexinoutset: i1, i4)
89 #pragma omp task depend(in: i1)
90 {
int th = omp_get_thread_num();
91 printf(
"task 8_%d, th %d\n", t, th);
#define omp_set_num_threads
int mutex_task(int task_id)
static void my_sleep(double sleeptime)
Utility function to have a sleep function with better resolution and which only stops one thread.