This is an archive of the discontinued LLVM Phabricator instance.

[OMPT] Fix interoperability test with GCC
ClosedPublic

Authored by Hahnfeld on Feb 28 2018, 10:23 AM.

Details

Summary

We have to ensure that the runtime is initialized _before_ waiting
for the two started threads to guarantee that the master threads
post their ompt_event_thread_begin before the worker threads. This
is not guaranteed in the parallel region where one worker thread
could start before the other master thread has invoked the callback.

The problem did not happen with Clang becauses the generated code
calls __kmpc_global_thread_num() and cashes its result for functions
that contain OpenMP pragmas.

Diff Detail

Repository
rOMP OpenMP

Event Timeline

Hahnfeld created this revision.Feb 28 2018, 10:23 AM
protze.joachim accepted this revision.Feb 28 2018, 1:23 PM

LGTM.

runtime/test/ompt/misc/interoperability.cpp
19–20

According to OpenMP terminology we are waiting for initial threads

This revision is now accepted and ready to land.Feb 28 2018, 1:23 PM
This revision was automatically updated to reflect the committed changes.