[Openmp-commits] [PATCH] D123042: [OpenMP] libomp: Add itt notifications to sync dependent tasks.

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu May 5 09:31:18 PDT 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG52d0ef3c00fc: [OpenMP] libomp: Add itt notifications to sync dependent tasks. (authored by AndreyChurbanov, committed by jlpeyton).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123042/new/

https://reviews.llvm.org/D123042

Files:
  openmp/runtime/src/kmp_taskdeps.cpp
  openmp/runtime/src/kmp_taskdeps.h


Index: openmp/runtime/src/kmp_taskdeps.h
===================================================================
--- openmp/runtime/src/kmp_taskdeps.h
+++ openmp/runtime/src/kmp_taskdeps.h
@@ -25,6 +25,9 @@
   kmp_int32 n = KMP_ATOMIC_DEC(&node->dn.nrefs) - 1;
   KMP_DEBUG_ASSERT(n >= 0);
   if (n == 0) {
+#if USE_ITT_BUILD && USE_ITT_NOTIFY
+    __itt_sync_destroy(node);
+#endif
     KMP_ASSERT(node->dn.nrefs == 0);
 #if USE_FAST_MEMORY
     __kmp_fast_free(thread, node);
@@ -125,11 +128,17 @@
   kmp_taskdata_t *next_taskdata;
   for (kmp_depnode_list_t *p = node->dn.successors; p; p = next) {
     kmp_depnode_t *successor = p->node;
+#if USE_ITT_BUILD && USE_ITT_NOTIFY
+    __itt_sync_releasing(successor);
+#endif
     kmp_int32 npredecessors = KMP_ATOMIC_DEC(&successor->dn.npredecessors) - 1;
 
     // successor task can be NULL for wait_depends or because deps are still
     // being processed
     if (npredecessors == 0) {
+#if USE_ITT_BUILD && USE_ITT_NOTIFY
+      __itt_sync_acquired(successor);
+#endif
       KMP_MB();
       if (successor->dn.task) {
         KA_TRACE(20, ("__kmp_release_deps: T#%d successor %p of %p scheduled "
Index: openmp/runtime/src/kmp_taskdeps.cpp
===================================================================
--- openmp/runtime/src/kmp_taskdeps.cpp
+++ openmp/runtime/src/kmp_taskdeps.cpp
@@ -45,6 +45,9 @@
 #ifdef KMP_SUPPORT_GRAPH_OUTPUT
   node->dn.id = KMP_ATOMIC_INC(&kmp_node_id_seed);
 #endif
+#if USE_ITT_BUILD && USE_ITT_NOTIFY
+  __itt_sync_create(node, "OMP task dep node", NULL, 0);
+#endif
 }
 
 static inline kmp_depnode_t *__kmp_node_ref(kmp_depnode_t *node) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123042.427354.patch
Type: text/x-patch
Size: 1630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220505/26373e77/attachment-0001.bin>


More information about the Openmp-commits mailing list