[Openmp-commits] [PATCH] D14383: Add OMPT events for the OpenMP taskwait construct.

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 5 08:11:33 PST 2015


protze.joachim created this revision.
protze.joachim added reviewers: jmellorcrummey, jlpeyton.
protze.joachim added a subscriber: openmp-commits.

This patch adds the implementation of OMPT tracing events for openMP taskwait constructs.


http://reviews.llvm.org/D14383

Files:
  runtime/src/kmp_tasking.c
  runtime/src/ompt-event-specific.h

Index: runtime/src/ompt-event-specific.h
===================================================================
--- runtime/src/ompt-event-specific.h
+++ runtime/src/ompt-event-specific.h
@@ -113,8 +113,8 @@
 #define ompt_event_barrier_begin_implemented            ompt_event_MAY_ALWAYS_TRACE
 #define ompt_event_barrier_end_implemented              ompt_event_MAY_ALWAYS_TRACE
 
-#define ompt_event_taskwait_begin_implemented           ompt_event_UNIMPLEMENTED
-#define ompt_event_taskwait_end_implemented             ompt_event_UNIMPLEMENTED
+#define ompt_event_taskwait_begin_implemented           ompt_event_MAY_ALWAYS_TRACE
+#define ompt_event_taskwait_end_implemented             ompt_event_MAY_ALWAYS_TRACE
 
 #define ompt_event_taskgroup_begin_implemented          ompt_event_UNIMPLEMENTED
 #define ompt_event_taskgroup_end_implemented            ompt_event_UNIMPLEMENTED
Index: runtime/src/kmp_tasking.c
===================================================================
--- runtime/src/kmp_tasking.c
+++ runtime/src/kmp_tasking.c
@@ -1305,6 +1305,23 @@
 
         thread = __kmp_threads[ gtid ];
         taskdata = thread -> th.th_current_task;
+
+#if OMPT_SUPPORT && OMPT_TRACE
+        ompt_task_id_t my_task_id;
+        ompt_parallel_id_t my_parallel_id;
+        
+        if (ompt_enabled) {
+            kmp_team_t *team = thread->th.th_team;
+            my_task_id = taskdata->ompt_task_info.task_id;
+            my_parallel_id = team->t.ompt_team_info.parallel_id;
+            
+            if (ompt_callbacks.ompt_callback(ompt_event_taskwait_begin)) {
+                ompt_callbacks.ompt_callback(ompt_event_taskwait_begin)(
+                                my_parallel_id, my_task_id);
+            }
+        }
+#endif
+
 #if USE_ITT_BUILD
         // Note: These values are used by ITT events as well.
 #endif /* USE_ITT_BUILD */
@@ -1338,6 +1355,14 @@
 
         // GEH TODO: shouldn't we have some sort of OMPRAP API calls here to mark end of wait?
         taskdata->td_taskwait_thread = - taskdata->td_taskwait_thread;
+
+#if OMPT_SUPPORT && OMPT_TRACE
+        if (ompt_enabled &&
+            ompt_callbacks.ompt_callback(ompt_event_taskwait_end)) {
+            ompt_callbacks.ompt_callback(ompt_event_taskwait_end)(
+                                my_parallel_id, my_task_id);
+        }
+#endif
     }
 
     KA_TRACE(10, ("__kmpc_omp_taskwait(exit): T#%d task %p finished waiting, "


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14383.39368.patch
Type: text/x-patch
Size: 2421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20151105/53982af2/attachment.bin>


More information about the Openmp-commits mailing list