If tool initialization returns 0, OMPT should not be active. The current
implementation provided some callback invocations in this case.
Differential Revision: https://reviews.llvm.org/D42709
llvm-svn: 324320
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);