[PATCH] D15656: Fix build error: OMPT_SUPPORT=true was not tested after locking changes were made

John Mellor-Crummey via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 15:48:35 PST 2015


jmellorcrummey created this revision.
jmellorcrummey added reviewers: tcramer, jlpeyton.
jmellorcrummey added subscribers: openmp-commits, llvm-commits.

Recent changes to support dynamic locks didn't consider the code compiled when OMPT_SUPPORT=true. As a result, the OMPT support was broken by recent changes to nested locks to support dynamic locks. For OMPT to work with dynamic locks, they need to provide a return code indicating whether a nested lock acquisition was the first or not.

This patch moves the OMPT support for nested locks into the #else case when DYNAMIC locks were not used. New support is needed for dynamic locks. This patch fixes the build and leaves a placeholder where the missing OMPT callbacks can be added either the author of the OMPT support for locks, or the dynamic locking support.

http://reviews.llvm.org/D15656

Files:
  runtime/src/kmp_csupport.c

Index: runtime/src/kmp_csupport.c
===================================================================
--- runtime/src/kmp_csupport.c
+++ runtime/src/kmp_csupport.c
@@ -2202,6 +2202,12 @@
     __kmp_itt_lock_acquired((kmp_user_lock_p)user_lock);
 #endif
 
+#if OMPT_SUPPORT && OMPT_TRACE
+    if (ompt_enabled) {
+        // missing support here: need to know whether acquired first or not
+    }
+#endif
+
 #else // KMP_USE_DYNAMIC_LOCK
     int acquire_status;
     kmp_user_lock_p lck;
@@ -2230,7 +2236,6 @@
 #if USE_ITT_BUILD
     __kmp_itt_lock_acquired( lck );
 #endif /* USE_ITT_BUILD */
-#endif // KMP_USE_DYNAMIC_LOCK
 
 #if OMPT_SUPPORT && OMPT_TRACE
     if (ompt_enabled) {
@@ -2243,6 +2248,8 @@
         }
     }
 #endif
+
+#endif // KMP_USE_DYNAMIC_LOCK
 }
 
 void


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15656.43279.patch
Type: text/x-patch
Size: 778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151218/39826ac6/attachment.bin>


More information about the llvm-commits mailing list