[Bug libfortran/40190] DATE_AND_TIME returns GMT hour sometimes with OpenMP

dfranke at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue May 19 09:11:00 GMT 2009



------- Comment #4 from dfranke at gcc dot gnu dot org  2009-05-19 09:11 -------
(In reply to comment #3)
> HJL is right, we should use the _r functions if available, if not we must
> protect the calls with a mutex.

Janne, if mutexes are added, could you also add a note to the docs of that
these function(s) may be a serialization point in OMP applications? Something
similar to RANDOM_NUMBER:

"Please note, this RNG is thread safe if used within OpenMP directives, i.e.,
its state will be consistent while called from multiple threads. However, the
KISS generator does not create random numbers in parallel from multiple
sources, but in sequence from a single source. If an OpenMP-enabled application
heavily relies on random numbers, one should consider employing a dedicated
parallel random number generator instead."

Thanks.

     Daniel


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40190



More information about the Gcc-bugs mailing list