Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Conditional Shared/Private in OpenMP parallel region?

$
0
0

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


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>