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
set random seed for batch job #227
Comments
Hi Max, unfortunately it is currently not possible to set the seed manually, but it would a nice feature to have indeed. Part of the problem is that random generators are not thread-safe (because they are stateful) so we instantiate new ones per thread which are all randomly seeded, otherwise you'd get artifacts. I could imagine setting the seed for the singlecpu (single-threaded) implementation, though. That one is much better suited for sampling anyways. Cheers, |
Hi Moritz, Yes, I am running in single cpu mode- I'm using fully reversible reaction dynamics which it seems does not have a multithread implementation. I'm happy to try to implement it myself with guidance. I would have tried already but I am not that comfortable with C++ so the layout of the source code is a little complicated for me. What I'm imagining is adding an option to the initialization of a simulation to set the seed, and then a function to get the seed as well (along with the corresponding python interface). Max |
The first step would be implementing an option to the |
Ok, I think for now I am going to use a workaround by setting the seed in an environment variable and modifying the randomlySeededGenerator function to read its value:
By the way, I think readdy is not compatible with the newest version of catch2 right now. In version 3 they changed the name of their header file. For the conda build script to work I had to set catch2=2 in meta.yaml. Max |
Hi, the way you pasted it here it is (unless im missing something) still not deterministic. Only if the |
Yep, it's not deterministic as written but as you suggest it can be modified to be so (maybe replace the r() and clck with zeros). |
Hi,
I am using Readdy for a reversible A + B <-> C simulation. I want to compute some statistics to high accuracy and so I am running a lot of trials, which would best be done as a batch job. Is there a way to set the seed for the random number generator for each job?
Sincerely,
Max Heldman
The text was updated successfully, but these errors were encountered: