Closed nikhilgupta10 closed 7 years ago
nikhilgupta10 imported these comments from Sourceforge: The user ciraci does not exist anymore. Therefore assigning this to afisher1. "andyfisher": * attachment _test_core_random_numberstream.glm added ,
"ciraci": * status changed from new to closed
RAND_MAX was indeed the problem.
,
I/u2019m taking a look at the failing autotests in my 64 bit Ubuntu vm. I noticed that all the failing autotest involve some type of random function in the object code. I/u2019m getting really weird outputs. For example, I created a test that just contained the following.
//test_core_random_number_stream.glm tests to make sure that the same random numbers are produced when the stream is fixed regardless of OS.
set randomseed=12150
module residential {
};
module tape;
module assert;
clock {
};
class house{
};
object house {
};
Here is the range of numbers from windows 64 and 32
0.010834 /u2013 0.998047
Here is the range of numbers from Ubuntu 64
1e-6 /u2013 3e-5
I noticed that we mask the random numbers with RAND_MAX in random.c. That number is 0x7FFF in windows and 0x7FFFFFFF in GNU C libraries for Linux. Could this account for the drastic difference in random numbers produced?
I tried changing the code to mask with number with 0x7FFF instead of RAND_MAX. I got different numbers but they are still the same orders of magnitude smaller than the ones generated in windows. I got this output while debugging in the #739 ticket_branch as my autotools are too new to successfully build the current state of trunk or 3.0.
,