#928: openmp parallelization within Exact broken ---------------------+------------------------------------------------------ Reporter: knarf | Owner: Type: defect | Status: new Priority: major | Milestone: ET_2012_05 Component: Other | Version: Resolution: | Keywords: ---------------------+------------------------------------------------------
Comment (by rhaas):
I beleieve that as long as all the threads are doing is reading a parameter then based upon tis value write some possibly static variables but all with the same data (which eg the boost routine does) then having the race condition is benign since they all just race to write the same data (unless of course the Fortran compiler does something strange such as first setting variables to zero then later changing them...). This of course fails as soon as there is a statement of the form "a = a + b" involving the saved variable "a".
A safer way is to put a single-thread call to the routine somewhere earlier and throw away its results that way the variables are intialized or use a OpenMP threadprivate statement (they are designed for precisely this application) which probably gives you the samllest diff and is also the most "standard conforming" way of handling this I think.