OpenMP flush vs flush (list)

In OpenMP, I can reset either the specified set of variables or the entire cache.

Does anyone have an idea about the effectiveness of this operation? Does it make sense to clear only variables that have really changed, or is it "flash everything" so fast that I should not worry?

I have linked lists that I need to erase from time to time in my threads. Should I iterate over the list and erase each item individually or just clear everything?

+2
source share
1 answer

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.

+1
source

Source: https://habr.com/ru/post/957053/


All Articles