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

Replace random number generator? #194

Closed
dhardy opened this issue Aug 24, 2017 · 5 comments
Closed

Replace random number generator? #194

dhardy opened this issue Aug 24, 2017 · 5 comments
Assignees

Comments

@dhardy
Copy link
Contributor

dhardy commented Aug 24, 2017

OpenMalaria uses the Mersenne Twister 19937 random number generator. I am not an expert on the topic but have heard that although the generator is reasonably good it has some "bad states" from which it takes a while to escape and sequences yielded by nearby seeds may take a while to diverge.

The best fast non-cryptographic RNGs I am aware of are Xoroshiro and PCG. Fast cryptographic generators may also be of interest, e.g. ISAAC.

@dhardy
Copy link
Contributor Author

dhardy commented Aug 24, 2017

On further reading, O'Neill doesn't seem to like Xoroshiro. He has some interesting blog posts.

@ThomasASmith
Copy link
Collaborator

I've downgraded this as I think the current code is not broken and there seems to be no overwhelming reason for changing the random number generator. I would want to know what is the potential saving in compute time.

@dhardy
Copy link
Contributor Author

dhardy commented Oct 3, 2017

I noticed in one of Theresa's scenarios that the random number generator took about 40% of the compute time; this was because of the extreme use of many intervention components and some "odd" behaviour (check coverage before checking whether component meets other conditions). Probably in other scenarios performance would not be massively affected; I can't actually measure impact without implementing the change however.

@dhardy dhardy self-assigned this Dec 14, 2018
@dhardy dhardy added 2: medium and removed 3: low labels Dec 14, 2018
@dhardy
Copy link
Contributor Author

dhardy commented Dec 14, 2018

This is a sub-set of #204.

@dhardy
Copy link
Contributor Author

dhardy commented Sep 5, 2019

This was done (at least partially) in #242.

@dhardy dhardy closed this as completed Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants