- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, Colleagues:
For an OpenMP parallel-do loop, I would like an array to be either private or shared, depending on a determination that includes an assessment of its size and the computational work required to determine its values. If the amount of work involved is large, I want to determine the array contents before I drop into the parallelized loop. In other circumstances, it's better to have a private copy of the array, and do the work in each loop iteration. Is there a way to make OpenMP clauses conditional? I could duplicate the code of the entire loop in two if-clauses, the branching depending on the assessment of the array in question, but it seems like poor craftsmanship.
David
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OpenMP variable attributes are compile-time constant. You can't make them dependent on a run-time test. It sounds to me as if you'll need two loops.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page