This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][Tools] Add omp_all_memory support for Archer
ClosedPublic

Authored by protze.joachim on Oct 15 2021, 9:14 AM.

Details

Summary

The semantic of depend(out:omp_all_memory) is quite similar to taskwait in that it separates all tasks (with dependency) created before an all_memory-task from all tasks (with dependency) created after an all_memory-task.
Only a single of such tasks can execute at a time. Similar to taskwait, we have a CV (AllMemory[1]) in the generating task to express the dependency sink semantic of an all_memory-task. In addition, AllMemory[0] describes the dependency source semantic of an all_memory-task. All tasks with dependency create an HB-arc towards the sink and terminate an HB-arc from the source.

Since we expect that not many applications will use such dependency, the support for handling the synchronization semantic is off by default and can be turned on using ARCHER_OPTION="all_memory=1". The most costly part is the precautionary posting of an HB-arc towards the sink, which represents a potentially contentious write from all concurrently executing sibling tasks. A warning is printed at runtime, when the option is off while such dependency is observed. In most cases the lazy activation will still lead to false alerts.

Diff Detail

Event Timeline

protze.joachim created this revision.Oct 15 2021, 9:14 AM
protze.joachim requested review of this revision.Oct 15 2021, 9:14 AM
Hahnfeld accepted this revision.Oct 25 2021, 11:26 AM

Sorry for the delay, looks good to me!

This revision is now accepted and ready to land.Oct 25 2021, 11:26 AM
This revision was landed with ongoing or failed builds.Jul 7 2023, 4:56 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2023, 4:56 AM