Reputation: 26256
How can I make static variables and functions (from a templatised class) private in OpenMP to have different values in each thread?
Upvotes: 3
Views: 2526
Reputation: 564333
Depending on the scenario, you should be able to use:
#pragma omp threadprivate(theVariable)
For details, see this article on using Thread-local Storage in OpenMP.
Upvotes: 3