Thread safety issue for random_number intrinsic


Reference Number : dpd200111195


Version : Intel Fortran Compiler version 11.0


Operating System : Windows, Linux, Mac OS X


Problem Description :    Calls to the Fortran intrinsic function RANDOM_NUMBER from different threads can sometimes return the same value


Resolution Status :   This has been resolved in the Intel Visual Fortran Compiler for Windows and in the Intel Fortran Compiler for Mac OS X, version 11.1, and in an  update to the Intel Fortran Compiler for Linux, version 11.1. RANDOM_NUMBER generates a single sequence of pseudorandom numbers. Accesses from different threads are synchronized, but the order in which threads access RANDOM_NUMBER, and hence the random_number streams that they receive, may vary from run to run.


[DISCLAIMER: The information on this web site is intended for hardware system manufacturers and software developers. Intel does not warrant the accuracy, completeness or utility of any information on this site. Intel may make changes to the information or the site at any time without notice. Intel makes no commitment to update the information at this site. ALL INFORMATION PROVIDED ON THIS WEBSITE IS PROVIDED "as is" without any express, implied, or statutory warranty of any kind including but not limited to warranties of merchantability, non-infringement of intellectual property, or fitness for any particular purpose. Independent companies manufacture the third-party products that are mentioned on this site. Intel is not responsible for the quality or performance of third-party products and makes no representation or warranty regarding such products. The third-party supplier remains solely responsible for the design, manufacture, sale and functionality of its products. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others.]
For more complete information about compiler optimizations, see our Optimization Notice.

2 comments

Top
Martyn Corden (Intel)'s picture

This is a much more general question than the specific issue explained here, and so is appropriate to the discussion forums, not the Knowledge Base. I have reposted your question to the Intel Visual Fortran Compiler for Windows forum at http://software.intel.com/en-us/forums/showthread.php?t=84828& and made an initial reply. We'll see if other users have more suggestions.

Maadi's picture

I am running Monte Carlo simulation and I have to run 1 million replications.
I have to run simulations simultaneously and using "Call Random_seed " to change my random seed and using command "Call random_number()" to generate random numbers.

I have noticed that when I run 20 simulations simultaneously I get some repeated results. This problem is because same randome numbers are generated.

How I can resolve this problem?
I am using IVF11 with windows.

I appreciate your help

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.