[Openmp-commits] [openmp] r252472 - [OMPT] Add OMPT events for the OpenMP taskwait construct.

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 9 07:57:04 PST 2015


Author: jlpeyton
Date: Mon Nov  9 09:57:04 2015
New Revision: 252472

URL: http://llvm.org/viewvc/llvm-project?rev=252472&view=rev
Log:
[OMPT] Add OMPT events for the OpenMP taskwait construct.

Modified:
    openmp/trunk/runtime/src/kmp_tasking.c
    openmp/trunk/runtime/src/ompt-event-specific.h

Modified: openmp/trunk/runtime/src/kmp_tasking.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_tasking.c?rev=252472&r1=252471&r2=252472&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_tasking.c (original)
+++ openmp/trunk/runtime/src/kmp_tasking.c Mon Nov  9 09:57:04 2015
@@ -1304,6 +1304,23 @@ __kmpc_omp_taskwait( ident_t *loc_ref, k
 
         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 */
@@ -1337,6 +1354,14 @@ __kmpc_omp_taskwait( ident_t *loc_ref, k
 
         // 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, "

Modified: openmp/trunk/runtime/src/ompt-event-specific.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/ompt-event-specific.h?rev=252472&r1=252471&r2=252472&view=diff
==============================================================================
--- openmp/trunk/runtime/src/ompt-event-specific.h (original)
+++ openmp/trunk/runtime/src/ompt-event-specific.h Mon Nov  9 09:57:04 2015
@@ -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




More information about the Openmp-commits mailing list