diff --git a/openmp/runtime/src/kmp_taskdeps.cpp b/openmp/runtime/src/kmp_taskdeps.cpp --- a/openmp/runtime/src/kmp_taskdeps.cpp +++ b/openmp/runtime/src/kmp_taskdeps.cpp @@ -647,11 +647,7 @@ ompt_data_t *taskwait_task_data) { if (ompt_enabled.ompt_callback_task_schedule) { ompt_callbacks.ompt_callback(ompt_callback_task_schedule)( - &(current_task->ompt_task_info.task_data), ompt_task_switch, - taskwait_task_data); - ompt_callbacks.ompt_callback(ompt_callback_task_schedule)( - taskwait_task_data, ompt_task_complete, - &(current_task->ompt_task_info.task_data)); + taskwait_task_data, ompt_taskwait_complete, NULL); } current_task->ompt_task_info.frame.enter_frame.ptr = NULL; *taskwait_task_data = ompt_data_none; @@ -700,7 +696,7 @@ ompt_callbacks.ompt_callback(ompt_callback_task_create)( &(current_task->ompt_task_info.task_data), &(current_task->ompt_task_info.frame), taskwait_task_data, - ompt_task_explicit | ompt_task_undeferred | ompt_task_mergeable, 1, + ompt_task_taskwait | ompt_task_undeferred | ompt_task_mergeable, 1, OMPT_LOAD_OR_GET_RETURN_ADDRESS(gtid)); } } diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h --- a/openmp/runtime/test/ompt/callback.h +++ b/openmp/runtime/test/ompt/callback.h @@ -34,7 +34,8 @@ "ompt_task_detach", // 4 "ompt_task_early_fulfill", // 5 "ompt_task_late_fulfill", // 6 - "ompt_task_switch" // 7 + "ompt_task_switch", // 7 + "ompt_taskwait_complete" // 8 }; static const char* ompt_cancel_flag_t_values[] = { "ompt_cancel_parallel", @@ -67,6 +68,8 @@ progress += sprintf(progress, "ompt_task_explicit"); if (type & ompt_task_target) progress += sprintf(progress, "ompt_task_target"); + if (type & ompt_task_taskwait) + progress += sprintf(progress, "ompt_task_taskwait"); if (type & ompt_task_undeferred) progress += sprintf(progress, "|ompt_task_undeferred"); if (type & ompt_task_untied) @@ -1015,7 +1018,8 @@ (second_task_data ? second_task_data->value : -1), ompt_task_status_t_values[prior_task_status], prior_task_status); if (prior_task_status == ompt_task_complete || - prior_task_status == ompt_task_late_fulfill) { + prior_task_status == ompt_task_late_fulfill || + prior_task_status == ompt_taskwait_complete) { printf("%" PRIu64 ":" _TOOL_PREFIX " ompt_event_task_end: task_id=%" PRIu64 "\n", ompt_get_thread_data()->value, first_task_data->value); } diff --git a/openmp/runtime/test/ompt/tasks/task_if0-depend.c b/openmp/runtime/test/ompt/tasks/task_if0-depend.c --- a/openmp/runtime/test/ompt/tasks/task_if0-depend.c +++ b/openmp/runtime/test/ompt/tasks/task_if0-depend.c @@ -63,8 +63,8 @@ // CHECK-SAME: parent_task_frame.reenter={{0x[0-f]+}}, // CHECK-SAME: new_task_id=[[SECOND_TASK:[0-f]+]], // CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}, -// CHECK-SAME: task_type=ompt_task_explicit|ompt_task_undeferred| -// CHECK-SAME: ompt_task_mergeable=1207959556, has_dependences=yes +// CHECK-SAME: task_type=ompt_task_taskwait|ompt_task_undeferred| +// CHECK-SAME: ompt_task_mergeable=1207959568, has_dependences=yes // CHECK: {{^}}[[MASTER_ID]]: ompt_event_dependences: // CHECK-SAME: task_id=[[SECOND_TASK]], deps=[([[ADDRX]],