28#define mysleep(n) Sleep(n)
31#define mysleep(n) usleep((n)*1000)
48#define DEP_ALL_MEM 0x80
70 #pragma omp atomic capture
72 th = omp_get_thread_num();
73 printf(
"task m_%d, th %d, checker %d\n",
ptask->
f_priv, th, lcheck);
76 printf(
"Error m1, checker %d != 1\n", lcheck);
79 #pragma omp atomic read
83 printf(
"Error m2, checker %d != 1\n", lcheck);
92 #pragma omp atomic capture
94 th = omp_get_thread_num();
95 printf(
"task 2_%d, th %d, checker %d\n",
ptask->
f_priv, th, lcheck);
98 printf(
"Error s1, checker %d != 1\n", lcheck);
101 #pragma omp atomic read
105 printf(
"Error s2, checker %d != 1\n", lcheck);
119 dep *dep_lst,
int nd_noalias,
dep *noalias_lst);
120static id loc = {0, 2, 0, 0,
";file;func;0;0;;"};
134 #pragma omp single nowait
139 int t = omp_get_thread_num();
140 #pragma omp task depend(in: i1, i2)
143 #pragma omp atomic capture
145 th = omp_get_thread_num();
146 printf(
"task 0_%d, th %d, checker %d\n", t, th, lcheck);
147 if (lcheck > 2 || lcheck < 1) {
149 printf(
"Error1, checker %d, not 1 or 2\n", lcheck);
152 #pragma omp atomic read
154 if (lcheck > 2 || lcheck < 1) {
157 printf(
"Error2, checker %d, not 1 or 2\n", lcheck);
162 #pragma omp task depend(in: i1, i2)
165 #pragma omp atomic capture
167 th = omp_get_thread_num();
168 printf(
"task 1_%d, th %d, checker %d\n", t, th, lcheck);
169 if (lcheck > 2 || lcheck < 1) {
171 printf(
"Error3, checker %d, not 1 or 2\n", lcheck);
174 #pragma omp atomic read
176 if (lcheck > 2 || lcheck < 1) {
178 printf(
"Error4, checker %d, not 1 or 2\n", lcheck);
186 sdep[0].
addr = (size_t)&i1;
189 sdep[1].
addr = (size_t)&i2;
197 sdep[0].
addr = (size_t)&i1;
206 #pragma omp task depend(in: i1, i2)
209 #pragma omp atomic capture
211 th = omp_get_thread_num();
212 printf(
"task 4_%d, th %d, checker %d\n", t, th, lcheck);
213 if (lcheck > 2 || lcheck < 1) {
215 printf(
"Error5, checker %d, not 1 or 2\n", lcheck);
218 #pragma omp atomic read
220 if (lcheck > 2 || lcheck < 1) {
222 printf(
"Error6, checker %d, not 1 or 2\n", lcheck);
227 #pragma omp task depend(in: i1, i2)
230 #pragma omp atomic capture
232 th = omp_get_thread_num();
233 printf(
"task 5_%d, th %d, checker %d\n", t, th, lcheck);
234 if (lcheck > 2 || lcheck < 1) {
236 printf(
"Error7, checker %d, not 1 or 2\n", lcheck);
239 #pragma omp atomic read
241 if (lcheck > 2 || lcheck < 1) {
243 printf(
"Error8, checker %d, not 1 or 2\n", lcheck);
251 sdep[0].
addr = (size_t)(-1);
262 sdep[1].
addr = (size_t)&i3;
268 #pragma omp task depend(in: i3)
271 #pragma omp atomic capture
273 th = omp_get_thread_num();
274 printf(
"task 8_%d, th %d, checker %d\n", t, th, lcheck);
277 printf(
"Error9, checker %d, != 1\n", lcheck);
280 #pragma omp atomic read
284 printf(
"Error10, checker %d, != 1\n", lcheck);
295 printf(
"failed, err = %d, checker = %d\n",
err,
checker);
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark d int
#define omp_set_num_threads
int thunk_s(int gtid, task_t *ptask)
int(* entry_t)(int, task_t *)
int thunk_m(int gtid, task_t *ptask)
int __kmpc_omp_task_with_deps(id *loc, int gtid, task_t *task, int ndeps, dep *dep_lst, int nd_noalias, dep *noalias_lst)
task_t * __kmpc_omp_task_alloc(id *loc, int gtid, int flags, size_t sz, size_t shar, entry_t rtn)
int __kmpc_global_thread_num(id *)