- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anyone knows if a module variable with private attribute can be assigned to threadprivate in OMP? I tried this, define several such module variables as threadprivate, the compiler seems to be OK with this but the program crashes for no reason.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The PRIVATE attribute would have no effect on OpenMP - all it does is control the visibility of the name to program units that USE the module.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A "static" variable/array/user defined typein a module can be thread private
A member variable within a user defined type cannot be thread private without the encapsulating user defined type being itself thread private. If this is not your circumstance, then you have a coding error. The usual errors relating to this is failure to initialize data that ought to have been initialized. I suggest you insert some conditional compiled asserts into your code to assure that what you assume to be true is in fact true.
Jim Dempsey
A member variable within a user defined type cannot be thread private without the encapsulating user defined type being itself thread private. If this is not your circumstance, then you have a coding error. The usual errors relating to this is failure to initialize data that ought to have been initialized. I suggest you insert some conditional compiled asserts into your code to assure that what you assume to be true is in fact true.
Jim Dempsey

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