This is an archive of the discontinued LLVM Phabricator instance.

Add more conditions to check whether task waiting is necessary in kmp_omp_taskwait()
ClosedPublic

Authored by vhscampos on Oct 27 2016, 6:25 PM.

Details

Summary

From:

  • comment in file kmp_tasking.c line 1489
  • file kmp_taskdeps.cpp line 558
  • file kmp_taskdeps.cpp line 491

I consider that, not only 'team_serial', but also 'tasking_ser' and 'final' flags from kmp_taskdata_t should be used to determine whether it's necessary to read the volatile flag.

By the same logic used in wait_deps and task_with_deps, any of these three flags being set is a sufficient condition for the task to skip the waiting.

Please let me know your opinions. Thanks.

Diff Detail

Event Timeline

vhscampos updated this revision to Diff 76151.Oct 27 2016, 6:25 PM
vhscampos retitled this revision from to Add more conditions to check whether task waiting is necessary in kmp_omp_taskwait().
vhscampos updated this object.
vhscampos added reviewers: jcownie, jlpeyton.
vhscampos added a subscriber: openmp-commits.
AndreyChurbanov added inline comments.
runtime/src/kmp_tasking.c
1483

The check "! taskdata->td_flags.tasking_ser" looks redundant here, because this condition is effectively the same as "__kmp_tasking_mode != tskm_immediate_exec" that has already been checked above at the line 1446.

The check of the td_flags.final flag does make sense.

vhscampos updated this revision to Diff 76466.Oct 31 2016, 1:35 PM
vhscampos added a reviewer: AndreyChurbanov.

Given that checking 'tasking_ser' is redundant, I removed it.

AndreyChurbanov accepted this revision.Nov 1 2016, 12:46 AM
AndreyChurbanov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 1 2016, 12:46 AM

committed r285678.