There is a minor issue in how the implicit data-sharings for nested tasks are computed.
For the following example:
int x; #pragma omp task shared(x) #pragma omp task x++;
We compute an implicit data-sharing of shared for x in the second task although I think that it should be firstprivate. Below you can find the part of the OpenMP spec that covers this example:
- In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above and that in the enclosing context is determined to be shared by all implicit tasks bound to the current team is shared.
- In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above is firstprivate.
Since each implicit-task has its own copy of x, we shouldn't apply the first rule.