- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been asked this question. I'm not confident about the answer, as applied to Intel -openmp (and KAI guide, for legacy users). Could one of the experts answer?
Adeveloper would like to use the same labeled COMMON both inside and outside a parallel region. It has a
C$OMP THREADPRIVATE
declaration.
Is this usage likely to cause problems? Does it make a difference,if the contents are re-initialized for each instance? I think they simply want to avoid possible increase in working set size, or unnecessary cache misses, on some platforms. So, if the proposed usage actually defeats one of those purposes, that would be useful information.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim -
Yes, use of COMMON block data declared to be THREADPRIVATE outside of a parallel region is legal. The OpenMP Fortran Spec 2.0 states, "During serial portions and MASTER sections of the program, accesses are to the master thread's copy of the common block or variable."
A copy of all THREADPRIVATE data is created for each thread upon entrance to the first parallel region. Initially undefined in value, data can be initialized from the master thread copy with a COPYIN clause. Otherwise, any data written to THREADPRIVATE variables will only be visible from the thread that wrote the value.
-- clay
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page