Index: openmp/runtime/src/kmp_taskdeps.cpp =================================================================== --- openmp/runtime/src/kmp_taskdeps.cpp +++ openmp/runtime/src/kmp_taskdeps.cpp @@ -540,47 +540,40 @@ ompt_enabled.ompt_callback_dependences) { kmp_int32 i; - new_taskdata->ompt_task_info.ndeps = ndeps + ndeps_noalias; - new_taskdata->ompt_task_info.deps = - (ompt_dependence_t *)KMP_OMPT_DEPS_ALLOC( - thread, (ndeps + ndeps_noalias) * sizeof(ompt_dependence_t)); + int ompt_ndeps = ndeps + ndeps_noalias; + ompt_dependence_t *ompt_deps = (ompt_dependence_t *)KMP_OMPT_DEPS_ALLOC( + thread, (ndeps + ndeps_noalias) * sizeof(ompt_dependence_t)); - KMP_ASSERT(new_taskdata->ompt_task_info.deps != NULL); + KMP_ASSERT(ompt_deps != NULL); for (i = 0; i < ndeps; i++) { - new_taskdata->ompt_task_info.deps[i].variable.ptr = - (void *)dep_list[i].base_addr; + ompt_deps[i].variable.ptr = (void *)dep_list[i].base_addr; if (dep_list[i].flags.in && dep_list[i].flags.out) - new_taskdata->ompt_task_info.deps[i].dependence_type = - ompt_dependence_type_inout; + ompt_deps[i].dependence_type = ompt_dependence_type_inout; else if (dep_list[i].flags.out) - new_taskdata->ompt_task_info.deps[i].dependence_type = - ompt_dependence_type_out; + ompt_deps[i].dependence_type = ompt_dependence_type_out; else if (dep_list[i].flags.in) - new_taskdata->ompt_task_info.deps[i].dependence_type = - ompt_dependence_type_in; + ompt_deps[i].dependence_type = ompt_dependence_type_in; + else if (dep_list[i].flags.mtx) + ompt_deps[i].dependence_type = ompt_dependence_type_mutexinoutset; } for (i = 0; i < ndeps_noalias; i++) { - new_taskdata->ompt_task_info.deps[ndeps + i].variable.ptr = - (void *)noalias_dep_list[i].base_addr; + ompt_deps[ndeps + i].variable.ptr = (void *)noalias_dep_list[i].base_addr; if (noalias_dep_list[i].flags.in && noalias_dep_list[i].flags.out) - new_taskdata->ompt_task_info.deps[ndeps + i].dependence_type = - ompt_dependence_type_inout; + ompt_deps[ndeps + i].dependence_type = ompt_dependence_type_inout; else if (noalias_dep_list[i].flags.out) - new_taskdata->ompt_task_info.deps[ndeps + i].dependence_type = - ompt_dependence_type_out; + ompt_deps[ndeps + i].dependence_type = ompt_dependence_type_out; else if (noalias_dep_list[i].flags.in) - new_taskdata->ompt_task_info.deps[ndeps + i].dependence_type = - ompt_dependence_type_in; + ompt_deps[ndeps + i].dependence_type = ompt_dependence_type_in; + else if (noalias_dep_list[i].flags.mtx) + ompt_deps[ndeps + i].dependence_type = + ompt_dependence_type_mutexinoutset; } ompt_callbacks.ompt_callback(ompt_callback_dependences)( - &(new_taskdata->ompt_task_info.task_data), - new_taskdata->ompt_task_info.deps, new_taskdata->ompt_task_info.ndeps); + &(new_taskdata->ompt_task_info.task_data), ompt_deps, ompt_ndeps); /* We can now free the allocated memory for the dependencies */ - /* For OMPD we might want to delay the free until task_end */ - KMP_OMPT_DEPS_FREE(thread, new_taskdata->ompt_task_info.deps); - new_taskdata->ompt_task_info.deps = NULL; - new_taskdata->ompt_task_info.ndeps = 0; + /* For OMPD we might want to delay the free until end of this function */ + KMP_OMPT_DEPS_FREE(thread, ompt_deps); } #endif /* OMPT_OPTIONAL */ #endif /* OMPT_SUPPORT */ Index: openmp/runtime/src/kmp_tasking.cpp =================================================================== --- openmp/runtime/src/kmp_tasking.cpp +++ openmp/runtime/src/kmp_tasking.cpp @@ -551,8 +551,6 @@ task->ompt_task_info.frame.enter_frame = ompt_data_none; task->ompt_task_info.frame.exit_frame_flags = ompt_frame_runtime | ompt_frame_framepointer; task->ompt_task_info.frame.enter_frame_flags = ompt_frame_runtime | ompt_frame_framepointer; - task->ompt_task_info.ndeps = 0; - task->ompt_task_info.deps = NULL; } // __ompt_task_start: Index: openmp/runtime/src/ompt-internal.h =================================================================== --- openmp/runtime/src/ompt-internal.h +++ openmp/runtime/src/ompt-internal.h @@ -57,8 +57,6 @@ ompt_data_t task_data; struct kmp_taskdata *scheduling_parent; int thread_num; - int ndeps; - ompt_dependence_t *deps; } ompt_task_info_t; typedef struct { Index: openmp/runtime/src/ompt-specific.cpp =================================================================== --- openmp/runtime/src/ompt-specific.cpp +++ openmp/runtime/src/ompt-specific.cpp @@ -262,8 +262,6 @@ lwt->ompt_task_info.frame.enter_frame = ompt_data_none; lwt->ompt_task_info.frame.exit_frame = ompt_data_none; lwt->ompt_task_info.scheduling_parent = NULL; - lwt->ompt_task_info.deps = NULL; - lwt->ompt_task_info.ndeps = 0; lwt->heap = 0; lwt->parent = 0; } Index: openmp/runtime/test/ompt/tasks/dependences.c =================================================================== --- openmp/runtime/test/ompt/tasks/dependences.c +++ openmp/runtime/test/ompt/tasks/dependences.c @@ -24,6 +24,14 @@ print_fuzzy_address(1); print_ids(0); +#pragma omp task depend(mutexinoutset : x) + { + x++; + delay(100); + } + print_fuzzy_address(2); + print_ids(0); + #pragma omp task depend(in : x) { x = -1; } print_ids(0); @@ -78,11 +86,29 @@ // CHECK: {{^}}[[MASTER_ID]]: ompt_event_dependences: // CHECK-SAME: task_id=[[SECOND_TASK]], deps=[([[ADDRX]], -// CHECK-SAME: ompt_dependence_type_in)], ndeps=1 +// CHECK-SAME: ompt_dependence_type_mutexinoutset)], ndeps=1 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_dependence_pair: // CHECK-SAME: first_task_id=[[FIRST_TASK]], second_task_id=[[SECOND_TASK]] +// CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[RETURN_ADDRESS]] +// CHECK: {{^}}[[MASTER_ID]]: task level 0: parallel_id=[[PARALLEL_ID]], +// CHECK-SAME: task_id=[[IMPLICIT_TASK_ID]], exit_frame=[[EXIT]], +// CHECK-SAME: reenter_frame=[[NULL]] + +// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create: +// CHECK-SAME: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[EXIT]], +// CHECK-SAME: parent_task_frame.reenter={{0x[0-f]+}}, +// CHECK-SAME: new_task_id=[[THIRD_TASK:[0-f]+]], codeptr_ra={{0x[0-f]+}}, +// CHECK-SAME: task_type=ompt_task_explicit=4, has_dependences=yes + +// CHECK: {{^}}[[MASTER_ID]]: ompt_event_dependences: +// CHECK-SAME: task_id=[[THIRD_TASK]], deps=[([[ADDRX]], +// CHECK-SAME: ompt_dependence_type_in)], ndeps=1 + +// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_dependence_pair: +// CHECK-SAME: first_task_id=[[SECOND_TASK]], second_task_id=[[THIRD_TASK]] + // CHECK: {{^}}[[MASTER_ID]]: task level 0: parallel_id=[[PARALLEL_ID]], // CHECK-SAME: task_id=[[IMPLICIT_TASK_ID]], exit_frame=[[EXIT]], // CHECK-SAME: reenter_frame=[[NULL]]