D9302.partial: bug fix for ittnotify: added missed timing on hierarchical barrier.
authorAndrey Churbanov <Andrey.Churbanov@intel.com>
Wed, 6 May 2015 18:34:15 +0000 (18:34 +0000)
committerAndrey Churbanov <Andrey.Churbanov@intel.com>
Wed, 6 May 2015 18:34:15 +0000 (18:34 +0000)
llvm-svn: 236623

openmp/runtime/src/kmp_barrier.cpp

index 72c9fa8..429390b 100644 (file)
@@ -743,6 +743,13 @@ __kmp_hierarchical_barrier_gather(enum barrier_type bt, kmp_info_t *this_thr,
                   gtid, team->t.t_id, tid, bt));
     KMP_DEBUG_ASSERT(this_thr == other_threads[this_thr->th.th_info.ds.ds_tid]);
 
+#if USE_ITT_BUILD && USE_ITT_NOTIFY
+    // Barrier imbalance - save arrive time to the thread
+    if(__kmp_forkjoin_frames_mode == 3 || __kmp_forkjoin_frames_mode == 2) {
+        this_thr->th.th_bar_arrive_time = __itt_get_timestamp();
+    }
+#endif
+
     (void)__kmp_init_hierarchical_barrier_thread(bt, thr_bar, nproc, gtid, tid, team);
 
     if (thr_bar->my_level) { // not a leaf (my_level==0 means leaf)