This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][Tools] Fix Archer handling of task dependencies
ClosedPublic

Authored by protze.joachim on Jun 3 2021, 3:54 AM.

Details

Summary

The current handling of dependencies in Archer has two flaws:

  • annotation of dependency synchronization is not limited to sibling tasks
  • annotation of in/out dependencies is based on the assumption, that dependency variables will rarely be byte-sized variables.

This patch introduces a map in the generating task to manage the dependency variables for the child tasks. The map is only accesses from the generating task, so no locking is necessary. This limits the dependency-based synchronization to sibling tasks.
This patch also introduces proper handling for new dependency types such as mutexinoutset and inoutset.

Diff Detail

Event Timeline

protze.joachim created this revision.Jun 3 2021, 3:54 AM
protze.joachim requested review of this revision.Jun 3 2021, 3:54 AM

I think at least this patch needs a clang-format, maybe also applies to the other recent patches.

openmp/tools/archer/ompt-tsan.cpp
887–897

Can we name internal functions without double underscores, which are actually not allowed by the standard? (__ompt_tsan_release_task should be renamed eventually) Also I understand release + acquire semantics, but "release" is actually a bit confusing because it's not about actually releasing the memory AFAICT. I understand it already was confusing before, but if somebody has a better proposal for naming (I don't right now) that would be great.

920

Is this removed on purpose?

Implement @Hahnfeld 's suggested changes

openmp/tools/archer/ompt-tsan.cpp
887–897

Since we a mid-term goal should be to refactor towards LLVM coding style, I changed the function names to use camelCase as required for function names.

I could live with renaming the task memory release function (__ompt_tsan_release_task) to freeTask.
The acquire/release refers to the similar semantics of locks.

920

Good catch! I missed this intermediate change in separating the changes into multiple patches.

protze.joachim marked 2 inline comments as done.

Applied a more recent version of clang-format

Hahnfeld accepted this revision.Jun 8 2021, 11:17 PM

LGTM, thanks

This revision is now accepted and ready to land.Jun 8 2021, 11:17 PM
This revision was landed with ongoing or failed builds.Jun 9 2021, 4:38 AM
This revision was automatically updated to reflect the committed changes.