diff options
author | Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> | 2016-03-24 12:52:04 +0000 |
---|---|---|
committer | Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> | 2016-03-24 12:52:04 +0000 |
commit | 1c1c71776a611ba92b0715ea813b47e0900e1074 (patch) | |
tree | c8dd18fcbaecd8801592189cffcc64ec99fd2826 /openmp/runtime/src | |
parent | bcf13da98ec4640adcaaadb6cb7b5e24aefb77f2 (diff) | |
download | bcm5719-llvm-1c1c71776a611ba92b0715ea813b47e0900e1074.tar.gz bcm5719-llvm-1c1c71776a611ba92b0715ea813b47e0900e1074.zip |
[OMPT] Fix duplicate implicit_task_end events for master thread with GCC
For non-serialized parallel regions the master thread issued two callbacks:
The first one in kmp_gsupport.c and the second in __kmp_join_call. Therefore
only trigger the callback in kmp_gsupport.c for serialized parallel regions.
Differential Revision: http://reviews.llvm.org/D16716
llvm-svn: 264264
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 |