diff options
author | Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> | 2016-03-21 12:37:52 +0000 |
---|---|---|
committer | Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> | 2016-03-21 12:37:52 +0000 |
commit | 6c250b714cf6ccee666ec30ecfb5cd2130d7de8f (patch) | |
tree | 38b2bd703bc089d89ef7875b9c8c9ac0fb0ed883 | |
parent | 4b3833df7d0a2e23896f030086d92c1bd86a1328 (diff) | |
download | bcm5719-llvm-6c250b714cf6ccee666ec30ecfb5cd2130d7de8f.tar.gz bcm5719-llvm-6c250b714cf6ccee666ec30ecfb5cd2130d7de8f.zip |
[OMPT] Fix wrong parent_task_id in serialized parallel_begin with GCC
Without this patch a simple '#pragma omp parallel num_threads(1)' leads to
ompt_event_parallel_begin: parent_task_id=3, [...], parallel_id=2, [...]
ompt_event_parallel_end: parallel_id=2, task_id=4, [...]
Differential Revision: http://reviews.llvm.org/D16714
llvm-svn: 263940
-rw-r--r-- | openmp/runtime/src/kmp_gsupport.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/openmp/runtime/src/kmp_gsupport.c b/openmp/runtime/src/kmp_gsupport.c index 406b2795da7..66d03c40a58 100644 --- a/openmp/runtime/src/kmp_gsupport.c +++ b/openmp/runtime/src/kmp_gsupport.c @@ -384,27 +384,32 @@ __kmp_GOMP_fork_call(ident_t *loc, int gtid, void (*unwrapped_task)(void *), mic static void __kmp_GOMP_serialized_parallel(ident_t *loc, kmp_int32 gtid, void (*task)(void *)) { - __kmp_serialized_parallel(loc, gtid); - #if OMPT_SUPPORT + ompt_parallel_id_t ompt_parallel_id; if (ompt_enabled) { - ompt_task_id_t ompt_task_id = __ompt_get_task_id_internal(0); - ompt_frame_t *ompt_frame = __ompt_get_task_frame_internal(0); - kmp_info_t *thr = __kmp_threads[gtid]; - - ompt_parallel_id_t ompt_parallel_id = __ompt_parallel_id_new(gtid); - ompt_task_id_t my_ompt_task_id = __ompt_task_id_new(gtid); + ompt_task_info_t *task_info = __ompt_get_taskinfo(0); + task_info->frame.exit_runtime_frame = NULL; - ompt_frame->exit_runtime_frame = NULL; + ompt_parallel_id = __ompt_parallel_id_new(gtid); // parallel region callback if (ompt_callbacks.ompt_callback(ompt_event_parallel_begin)) { int team_size = 1; ompt_callbacks.ompt_callback(ompt_event_parallel_begin)( - ompt_task_id, ompt_frame, ompt_parallel_id, + task_info->task_id, &task_info->frame, ompt_parallel_id, team_size, (void *) task, OMPT_INVOKER(fork_context_gnu)); } + } +#endif + + __kmp_serialized_parallel(loc, gtid); + +#if OMPT_SUPPORT + if (ompt_enabled) { + kmp_info_t *thr = __kmp_threads[gtid]; + + ompt_task_id_t my_ompt_task_id = __ompt_task_id_new(gtid); // set up lightweight task ompt_lw_taskteam_t *lwt = (ompt_lw_taskteam_t *) |