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.
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.