diff options
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r-- | openmp/runtime/src/kmp_gsupport.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/openmp/runtime/src/kmp_gsupport.c b/openmp/runtime/src/kmp_gsupport.c index 66d03c40a58..b25a878f656 100644 --- a/openmp/runtime/src/kmp_gsupport.c +++ b/openmp/runtime/src/kmp_gsupport.c @@ -482,26 +482,21 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_END)(void) #if OMPT_SUPPORT ompt_parallel_id_t parallel_id; + ompt_task_id_t serialized_task_id; ompt_frame_t *ompt_frame = NULL; if (ompt_enabled) { ompt_team_info_t *team_info = __ompt_get_teaminfo(0, NULL); parallel_id = team_info->parallel_id; + ompt_task_info_t *task_info = __ompt_get_taskinfo(0); + serialized_task_id = task_info->task_id; + // Record that we re-entered the runtime system in the implicit // task frame representing the parallel region. - ompt_frame = __ompt_get_task_frame_internal(0); + ompt_frame = &task_info->frame; ompt_frame->reenter_runtime_frame = __builtin_frame_address(0); -#if OMPT_TRACE - if (ompt_enabled && - ompt_callbacks.ompt_callback(ompt_event_implicit_task_end)) { - ompt_task_info_t *task_info = __ompt_get_taskinfo(0); - ompt_callbacks.ompt_callback(ompt_event_implicit_task_end)( - parallel_id, task_info->task_id); - } -#endif - // unlink if necessary. no-op if there is not a lightweight task. ompt_lw_taskteam_t *lwt = __ompt_lw_taskteam_unlink(thr); // GOMP allocates/frees lwt since it can't be kept on the stack @@ -546,6 +541,14 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_END)(void) #endif } else { +#if OMPT_SUPPORT && OMPT_TRACE + if (ompt_enabled && + ompt_callbacks.ompt_callback(ompt_event_implicit_task_end)) { + ompt_callbacks.ompt_callback(ompt_event_implicit_task_end)( + parallel_id, serialized_task_id); + } +#endif + __kmpc_end_serialized_parallel(&loc, gtid); #if OMPT_SUPPORT |