[Openmp-commits] [PATCH] D42709: [OMPT] Fix tool initialization returning 0

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 30 14:18:37 PST 2018


protze.joachim created this revision.
protze.joachim added reviewers: jlpeyton, Hahnfeld, hbae.

If tool initialization returns 0, OMPT should not be active. The current implementation provided some callback invocations in this case.


https://reviews.llvm.org/D42709

Files:
  runtime/src/ompt-general.cpp


Index: runtime/src/ompt-general.cpp
===================================================================
--- runtime/src/ompt-general.cpp
+++ runtime/src/ompt-general.cpp
@@ -332,6 +332,12 @@
     ompt_enabled.enabled = !!ompt_start_tool_result->initialize(
         ompt_fn_lookup, &(ompt_start_tool_result->tool_data));
 
+    if (!ompt_enabled.enabled)
+    { // tool not enabled, zero out the bitmap, and done
+      memset(&ompt_enabled, 0, sizeof(ompt_enabled));
+      return;
+    }
+
     ompt_thread_t *root_thread = ompt_get_thread();
 
     ompt_set_thread_state(root_thread, omp_state_overhead);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42709.132048.patch
Type: text/x-patch
Size: 608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180130/04c0f359/attachment.bin>


More information about the Openmp-commits mailing list