export libomnitrace-dl.so to OMP_TOOL_LIBRARIES (#27)

* export libomnitrace-dl.so to OMP_TOOL_LIBRARIES

* Disable ompt_context_t

- ompt.cpp enables/disables context
- Update timemory submodule :: handles disabled context

[ROCm/rocprofiler-systems commit: d4b8e25765]
This commit is contained in:
Jonathan R. Madsen
2022-06-10 13:16:11 -05:00
committed by GitHub
parent 04edcf33c3
commit 7f7d0ed34c
3 changed files with 15 additions and 2 deletions
Submodule projects/rocprofiler-systems/external/timemory updated: dc9f56d408...fcb2645617
@@ -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);
@@ -54,13 +54,15 @@ namespace ompt
namespace
{
std::unique_ptr<ompt_bundle_t> f_bundle = {};
bool _init_toolset_off = (trait::runtime_enabled<ompt_toolset_t>::set(false), true);
bool _init_toolset_off = (trait::runtime_enabled<ompt_toolset_t>::set(false),
trait::runtime_enabled<ompt_context_t>::set(false), true);
} // namespace
void
setup()
{
trait::runtime_enabled<ompt_toolset_t>::set(true);
trait::runtime_enabled<ompt_context_t>::set(true);
comp::user_ompt_bundle::global_init();
comp::user_ompt_bundle::reset();
tim::auto_lock_t lk{ tim::type_mutex<ompt_handle_t>() };
@@ -77,6 +79,8 @@ shutdown()
f_bundle->stop();
ompt_context_t::cleanup();
trait::runtime_enabled<ompt_toolset_t>::set(false);
trait::runtime_enabled<ompt_context_t>::set(false);
comp::user_ompt_bundle::reset();
}
f_bundle.reset();
}