This page helps you setting up your own software and the Diehard
testuite to test your RNGs.
Note: Testing your RNGs with
Diehard is optional, but will certainly have a good influence on your
report's grade.
George Marsaglia has collected a range of sophisticated tests in the Diehard package. The testsuite reads in large files that your RNG has produced, and performs selected tests on them. You probably have to download the source code and compile from scratch. Be sure to compile it as a 32-bits application, otherwise 32-bits random number output read into a 64-bit int will have a very regular pattern in the first 32 bits.
We would like to run the new rand program as follows:
[labsc@oeleboeter:~/labsci/rng]$ ./rand 2500000 2 diehard
where 2500000 is still the amount of numbers, 2 selects the type of generator (see file RNG_factory.h), and diehard switches on the 'diehard' mode.
First make sure that the diehard keyword can be specified and read in/checked upon correctly in your main function.
Next, identify the points in your main program where the execution in 'diehard' mode will differ from that in normal mode. Extend your code to support the new mode.
Among the file printing routines in util.cc there is already a
print2filebin function.
In your main function call the new print function at the appropriate
point.
Also verify that your program still is able to run in normal mode and produces the same results as before.
If you want to run all 15 Diehard tests at once, make sure your data files contain about 2.5 million numbers. They will be about 10 megabytes in size.
See the Diehard website: http://stat.fsu.edu/pub/diehard/ or for a more recent version the Dieharder website http://www.phy.duke.edu/~rgb/General/dieharder.php.
Run various tests on the RNGs that you have implemented. Can you pass all tests? If not, why is that, and is it bad for our application (Monte Carlo integration)?
Note: the testing of RNGs should be part of your final report. Do not include the raw output of Diehard into your report. Instead, motivate your conclusions with some distinctive test outcomes.