Skip to content

Commit

Permalink
Fix OMPT initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmadsen committed Sep 28, 2022
1 parent 1c00d4c commit fd8eccf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/lib/omnitrace/library/ompt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#include "api.hpp"
#include "library/common.hpp"
#include "library/config.hpp"
#include "library/debug.hpp"
#include "library/defines.hpp"

#include <timemory/defines.h>
Expand Down Expand Up @@ -97,6 +101,16 @@ ompt_start_tool(unsigned int omp_version, const char* runtime_version)
OMNITRACE_METADATA("OMP_VERSION", omp_version);
OMNITRACE_METADATA("OMP_RUNTIME_VERSION", runtime_version);

if(!omnitrace::settings_are_configured())
{
OMNITRACE_BASIC_WARNING(
0,
"[%s] invoked before omnitrace was initialized. In instrumentation mode, "
"settings exported to the environment have not been propagated yet...\n",
__FUNCTION__);
omnitrace::configure_settings();
}

static bool _use_ompt = omnitrace::config::get_use_ompt();
static auto ompt_initialize = [](ompt_function_lookup_t lookup,
int initial_device_num,
Expand Down

0 comments on commit fd8eccf

Please sign in to comment.