Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with random number generator. #1

Open
mcpherson opened this issue Jun 27, 2013 · 1 comment
Open

Issue with random number generator. #1

mcpherson opened this issue Jun 27, 2013 · 1 comment
Labels

Comments

@mcpherson
Copy link
Contributor

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).

@ghost ghost assigned richards12 Jun 27, 2013
@HydroBench
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants