Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling OMPT sometimes requires setting OMP_TOOL_LIBRARIES #19

Closed
jrmadsen opened this issue Jun 1, 2022 · 0 comments · Fixed by #27
Closed

Enabling OMPT sometimes requires setting OMP_TOOL_LIBRARIES #19

jrmadsen opened this issue Jun 1, 2022 · 0 comments · Fixed by #27
Labels
libomnitrace-dl Involves omnitrace-dl library OMPT OpenMP tools

Comments

@jrmadsen
Copy link
Collaborator

jrmadsen commented Jun 1, 2022

It has been noted that some versions of OMPT in OpenMP v5 require:

export OMP_TOOL_LIBRARIES=libomnitrace-dl.so

In later versions, OpenMP will dlsym(RTLD_NEXT, ...) and look for ompt_start_tool.
To support older OMPT implementations omnitrace-dl should do this:

std::string _omni_omp_libs = "libomnitrace-dl.so";
const char* _omp_libs      = getenv("OMP_TOOL_LIBRARIES");
if(_omp_libs) 
    _omni_omp_libs = common::join(':', _omp_libs, "libomnitrace-dl.so");
setenv("OMP_TOOL_LIBRARIES", _omni_omp_libs.c_str(), 1);
@jrmadsen jrmadsen added libomnitrace-dl Involves omnitrace-dl library omnitrace-instrument Involves the omnitrace-instrument executable (binary instrumenter) OMPT OpenMP tools and removed omnitrace-instrument Involves the omnitrace-instrument executable (binary instrumenter) labels Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libomnitrace-dl Involves omnitrace-dl library OMPT OpenMP tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant