This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can OpenMP be configured to make all global variables thread-local by default?

Hi,

We are using many libraries which are not openmp-safe (e.g. the EDMA3 LLD) - the way we are using them allows us to simply duplicate the data-structures for each core. Those libraries were not designed with a shared memory model for their data structures in mind. 
However, when using OpenMP all global variables are shared by default, which causes problems of course.

One way to solve this problem would be to annotate tons of global variables as thread-private which would mean a major effort and in our case completly unpractical.

Is there any way to switch the OpenMP runtime from share-all to share-none for global variables by default, so that I just annotate the global variables as shared that really need to be shared?

Thx