We have a set of programs that generate some random numbers, but we have trouble creating code so that the same random numbers are generated across different computers. Attached is a set of programs. If you run the master-file (master.prg) you will generate some random numbers in a series X:
Code: Select all
is included at the top of the master-file. The random numbers in X are generated in the program file: ces_mone_carlo\random_draw_epsilon.
If we rerun the program files on the same computer, the same random numbers are generated. However, if we run the exact same files on a different computer, a different set of variables are generated. What is strange, is that if we move the generation of the series X to lines 13 to 15 in the program (from lines 27 to 29), the program generates the same random numbers in the variable X, even when executed from different computers.
Is there a bug somewehere, or is it just that we do not understand how the rndseed function works? Or is there another explanation?
Do you have a suggestion on how we can ensure that the same random numbers are generated, irrespective of what type of computer that is used to execute the programs?