[ET Trac] [Einstein Toolkit] #928: openmp parallelization within Exact broken

Einstein Toolkit trac-noreply at einsteintoolkit.org
Fri May 25 09:44:10 CDT 2012


#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.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/928#comment:3>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list