Considering the recommendations of the OpenMP 3.1 standard:
The use of the flash list design is extremely error prone and users are strongly advised not to try.
and the following sentence:
An implementation can implement a flash with a list, ignoring the list, and treat it the same way as a flash without a list.
I would first apply the solution with pragma omp flush (without any list).
Then I would really think before trying to optimize this implementation by adding a list for hidden constructs, since the code will not be portable in performance.
source share