summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/kmp_csupport.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/openmp/runtime/src/kmp_csupport.cpp b/openmp/runtime/src/kmp_csupport.cpp
index 51934cbdffc..ac76794c56f 100644
--- a/openmp/runtime/src/kmp_csupport.cpp
+++ b/openmp/runtime/src/kmp_csupport.cpp
@@ -71,6 +71,14 @@ void __kmpc_end(ident_t *loc) {
__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
}
/*!
OpenPOWER on IntegriCloud