[Openmp-commits] [PATCH] D52628: Shutdown library on Windows if possible for better OMPT behavior.

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Oct 2 12:17:23 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL343619: [OpenMP] Shutdown library on Windows if possible for better OMPT behavior (authored by jlpeyton, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D52628?vs=167384&id=167999#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52628

Files:
  openmp/trunk/runtime/src/kmp_csupport.cpp


Index: openmp/trunk/runtime/src/kmp_csupport.cpp
===================================================================
--- openmp/trunk/runtime/src/kmp_csupport.cpp
+++ openmp/trunk/runtime/src/kmp_csupport.cpp
@@ -71,6 +71,14 @@
 
     __kmp_internal_end_thread(-1);
   }
+#if KMP_OS_WINDOWS && OMPT_SUPPORT
+  // Normal exit process on Windows does not allow worker threads of the final
+  // parallel region to finish reporting their events, so shutting down the
+  // library here fixes the issue at least for the cases where __kmpc_end() is
+  // placed properly.
+  if (ompt_enabled.enabled)
+    __kmp_internal_end_library(__kmp_gtid_get_specific());
+#endif
 }
 
 /*!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52628.167999.patch
Type: text/x-patch
Size: 674 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20181002/fa030842/attachment.bin>


More information about the Openmp-commits mailing list