Index: runtime/src/kmp_gsupport.c =================================================================== --- runtime/src/kmp_gsupport.c +++ runtime/src/kmp_gsupport.c @@ -384,12 +384,19 @@ static void __kmp_GOMP_serialized_parallel(ident_t *loc, kmp_int32 gtid, void (*task)(void *)) { +#if OMPT_SUPPORT + // save task info prior to calling __kmp_serialized_parallel + ompt_task_info_t *task_info; + if (ompt_enabled) { + task_info = __ompt_get_taskinfo(0); + } +#endif + __kmp_serialized_parallel(loc, gtid); #if OMPT_SUPPORT 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); + ompt_frame_t *ompt_frame = &task_info->frame; kmp_info_t *thr = __kmp_threads[gtid]; ompt_parallel_id_t ompt_parallel_id = __ompt_parallel_id_new(gtid); @@ -401,7 +408,7 @@ 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, ompt_frame, ompt_parallel_id, team_size, (void *) task, OMPT_INVOKER(fork_context_gnu)); }