This is an archive of the discontinued LLVM Phabricator instance.

[OMPT] Fix parallel_data in implicit barrier-end
ClosedPublic

Authored by Hahnfeld on Feb 14 2018, 11:30 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

Hahnfeld created this revision.Feb 14 2018, 11:30 AM
Hahnfeld added inline comments.
runtime/test/ompt/parallel/normal.c
33–35 ↗(On Diff #134277)

Another option would be to only use CHECK-DAG but this doesn't enforce the requirement that the arguments are on the same line. IMO we don't lose any coverage because the same information is checked in THREADS.

To be honest, I even think we could drop the previous CHECK-SAME lines and only check that we get the right callbacks before parallel_end...

protze.joachim requested changes to this revision.Feb 17 2018, 6:46 AM
protze.joachim added inline comments.
runtime/src/kmp_barrier.cpp
1892 ↗(On Diff #134277)

Please keep that one and remove the duplikate at the end of the block, including the comment.

You can add a comment here, that this state change is important for the algorithm described in runtime/src/kmp_wait_release.h:161

runtime/src/kmp_runtime.cpp
7171 ↗(On Diff #134277)

Same here:
Please keep that one and remove the duplikate at the end of the block, including the comment.

You can add a comment here, that this state change is important for the algorithm described in runtime/src/kmp_wait_release.h:161

runtime/test/ompt/parallel/normal.c
16 ↗(On Diff #134277)

The idea of listing the individual callbacks here was to eventually allow most tests to run successfully with LIBOMP_OMPT_OPTIONAL=off.
But, I guess, this could also be achieved by not registering the optional callbacks in that case.

33–35 ↗(On Diff #134277)

Only checking for the right sequence of events here sounds good to me.

This revision now requires changes to proceed.Feb 17 2018, 6:46 AM
Hahnfeld added inline comments.Feb 17 2018, 7:11 AM
runtime/src/kmp_barrier.cpp
1892 ↗(On Diff #134277)

I'm not sure I understand your reasoning here: There is no intervening call to __kmp_wait_template inside this OMPT block so I don't think there is an observable difference except the state during the callback.

runtime/test/ompt/parallel/normal.c
33–35 ↗(On Diff #134277)

Okay, I'll remove the other CHECK-SAMEs as proposed.

protze.joachim added inline comments.Feb 17 2018, 8:39 AM
runtime/src/kmp_barrier.cpp
1892 ↗(On Diff #134277)

The reasoning for having the status change here is independent of the changed comment. omp_state_wait_barrier_implicit should indicate, that the thread is actually waiting in the barrier. Calling the callback functions is more the overhead kind of state, so I would prefer to keep the state change here and remove the redundant assignment below.

The comment below is wrong anyway.

Hahnfeld updated this revision to Diff 135646.Feb 23 2018, 8:09 AM
Hahnfeld marked 7 inline comments as done.

Move state change to omp_state_overhead as requested, collapse one if and add check for ompt_enabled.enabled to the other, drop argument checking from CHECK prefix.

This revision is now accepted and ready to land.Feb 23 2018, 8:45 AM
This revision was automatically updated to reflect the committed changes.