You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked at the random generator used in CoMD with great interest since I did the exact same thing (in F90) for one of our code.
In my code, I bumped into the problem that with very large simulations, my seed could wrapup through 0. And if seed == 0 then my rng and lcg61 will stay at 0 forever. And I wasn't exiting gasdev :-(
It means also that the actual interval for lcg61 is ]0., 1.].
A guard against that situation in mkSeed would be useful. And I wonder if a protection against zero would not be a good idea too in lcg61.
As an improvement I would suggest to move lcg61 in the header as "inline" so that it can be vectorized easily if used outside gasdev (at least on SNB, something's wrong on KNC).
The text was updated successfully, but these errors were encountered:
Running lcg61 for a (very) long time with a seed != 0 doesn't seem to wrap up via 0. Could it be possible to formally demonstrate that if seek != then the serie never goes through 0 ? I'll probe around me.
Guillaume Colin de Verdière
Posting this issue on behalf of Guillaume:
I looked at the random generator used in CoMD with great interest since I did the exact same thing (in F90) for one of our code.
In my code, I bumped into the problem that with very large simulations, my seed could wrapup through 0. And if seed == 0 then my rng and lcg61 will stay at 0 forever. And I wasn't exiting gasdev :-(
It means also that the actual interval for lcg61 is ]0., 1.].
A guard against that situation in mkSeed would be useful. And I wonder if a protection against zero would not be a good idea too in lcg61.
As an improvement I would suggest to move lcg61 in the header as "inline" so that it can be vectorized easily if used outside gasdev (at least on SNB, something's wrong on KNC).
The text was updated successfully, but these errors were encountered: