Index: openmp/trunk/runtime/src/kmp_runtime.c =================================================================== --- openmp/trunk/runtime/src/kmp_runtime.c +++ openmp/trunk/runtime/src/kmp_runtime.c @@ -3986,8 +3986,13 @@ kmp_task_team_t * task_team = thread->th.th_task_team; // we need to wait for the proxy tasks before finishing the thread - if ( task_team != NULL && task_team->tt.tt_found_proxy_tasks ) + if ( task_team != NULL && task_team->tt.tt_found_proxy_tasks ) { +#if OMPT_SUPPORT + // the runtime is shutting down so we won't report any events + thread->th.ompt_thread_info.state = ompt_state_undefined; +#endif __kmp_task_team_wait(thread, team, NULL ); + } #endif __kmp_reset_root(gtid, root); Index: openmp/trunk/runtime/src/kmp_wait_release.h =================================================================== --- openmp/trunk/runtime/src/kmp_wait_release.h +++ openmp/trunk/runtime/src/kmp_wait_release.h @@ -96,15 +96,17 @@ KA_TRACE(20, ("__kmp_wait_sleep: T#%d waiting for flag(%p)\n", th_gtid, flag)); #if OMPT_SUPPORT && OMPT_BLAME - if (ompt_status == ompt_status_track_callback) { - if (this_thr->th.ompt_thread_info.state == ompt_state_idle){ + ompt_state_t ompt_state = this_thr->th.ompt_thread_info.state; + if (ompt_status == ompt_status_track_callback && + ompt_state != ompt_state_undefined) { + if (ompt_state == ompt_state_idle) { if (ompt_callbacks.ompt_callback(ompt_event_idle_begin)) { ompt_callbacks.ompt_callback(ompt_event_idle_begin)(th_gtid + 1); } } else if (ompt_callbacks.ompt_callback(ompt_event_wait_barrier_begin)) { - KMP_DEBUG_ASSERT(this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier || - this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_implicit || - this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_explicit); + KMP_DEBUG_ASSERT(ompt_state == ompt_state_wait_barrier || + ompt_state == ompt_state_wait_barrier_implicit || + ompt_state == ompt_state_wait_barrier_explicit); ompt_lw_taskteam_t* team = this_thr->th.th_team->t.ompt_serialized_team_info; ompt_parallel_id_t pId; @@ -235,15 +237,16 @@ } #if OMPT_SUPPORT && OMPT_BLAME - if (ompt_status == ompt_status_track_callback) { - if (this_thr->th.ompt_thread_info.state == ompt_state_idle){ + if (ompt_status == ompt_status_track_callback && + ompt_state != ompt_state_undefined) { + if (ompt_state == ompt_state_idle) { if (ompt_callbacks.ompt_callback(ompt_event_idle_end)) { ompt_callbacks.ompt_callback(ompt_event_idle_end)(th_gtid + 1); } } else if (ompt_callbacks.ompt_callback(ompt_event_wait_barrier_end)) { - KMP_DEBUG_ASSERT(this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier || - this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_implicit || - this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_explicit); + KMP_DEBUG_ASSERT(ompt_state == ompt_state_wait_barrier || + ompt_state == ompt_state_wait_barrier_implicit || + ompt_state == ompt_state_wait_barrier_explicit); ompt_lw_taskteam_t* team = this_thr->th.th_team->t.ompt_serialized_team_info; ompt_parallel_id_t pId;