[Omp] Threadprivate variables and nested parallelism
Jakub Jelinek
jakub at redhat.com
Wed Dec 13 10:40:23 PST 2006
On Wed, Dec 13, 2006 at 10:34:08AM -0800, Haab, Grant wrote:
> I think the implementation you describe would no longer work in this
> circumstance. Shared clauses for threadprivate objects could be
> implemented by calls to a run-time library that maintains a hash table
> that takes as input some global thread identfier + original variable
> address and returns the corresponding threadprivate variable address.
> The mapping in the hash table for threadprivate object would have to be
> modified at the start and end of each nested parallel region with that
> object listed in its "shared" clause.
But it can be done equally well just with an indirection on the application
side: the threadprivate variable would be just a pointer, in the outer parallel
it would be initialized to allocated chunk of memory and in the nested
parallel using copyin.
Jakub
More information about the Omp
mailing list