diff --git a/projects/rocprofiler-systems/external/timemory b/projects/rocprofiler-systems/external/timemory index dc9f56d408..fcb2645617 160000 --- a/projects/rocprofiler-systems/external/timemory +++ b/projects/rocprofiler-systems/external/timemory @@ -1 +1 @@ -Subproject commit dc9f56d4085d9a9fce06bcdd574e9e36cae5ac6b +Subproject commit fcb26456170b8852f0e6ce1743efd4b781ca5431 diff --git a/projects/rocprofiler-systems/source/lib/omnitrace-dl/dl.cpp b/projects/rocprofiler-systems/source/lib/omnitrace-dl/dl.cpp index 49ad527545..eaa6eaa8e1 100644 --- a/projects/rocprofiler-systems/source/lib/omnitrace-dl/dl.cpp +++ b/projects/rocprofiler-systems/source/lib/omnitrace-dl/dl.cpp @@ -141,6 +141,15 @@ struct OMNITRACE_HIDDEN_API indirect #if defined(OMNITRACE_USE_ROCTRACER) && OMNITRACE_USE_ROCTRACER > 0 auto _omni_hsa_lib = m_omnilib; setenv("HSA_TOOLS_LIB", _omni_hsa_lib.c_str(), 0); +#endif +#if OMNITRACE_USE_OMPT > 0 + if(get_env("OMNITRACE_USE_OMPT", true)) + { + std::string _omni_omp_libs = find_path("libomnitrace-dl.so"); + const char* _omp_libs = getenv("OMP_TOOL_LIBRARIES"); + if(_omp_libs) _omni_omp_libs = common::join(':', _omni_omp_libs, _omp_libs); + setenv("OMP_TOOL_LIBRARIES", _omni_omp_libs.c_str(), 1); + } #endif m_omnihandle = open(m_omnilib); m_userhandle = open(m_userlib); diff --git a/projects/rocprofiler-systems/source/lib/omnitrace/library/ompt.cpp b/projects/rocprofiler-systems/source/lib/omnitrace/library/ompt.cpp index ca468d4363..6a64b297a9 100644 --- a/projects/rocprofiler-systems/source/lib/omnitrace/library/ompt.cpp +++ b/projects/rocprofiler-systems/source/lib/omnitrace/library/ompt.cpp @@ -54,13 +54,15 @@ namespace ompt namespace { std::unique_ptr f_bundle = {}; -bool _init_toolset_off = (trait::runtime_enabled::set(false), true); +bool _init_toolset_off = (trait::runtime_enabled::set(false), + trait::runtime_enabled::set(false), true); } // namespace void setup() { trait::runtime_enabled::set(true); + trait::runtime_enabled::set(true); comp::user_ompt_bundle::global_init(); comp::user_ompt_bundle::reset(); tim::auto_lock_t lk{ tim::type_mutex() }; @@ -77,6 +79,8 @@ shutdown() f_bundle->stop(); ompt_context_t::cleanup(); trait::runtime_enabled::set(false); + trait::runtime_enabled::set(false); + comp::user_ompt_bundle::reset(); } f_bundle.reset(); }