-
Notifications
You must be signed in to change notification settings - Fork 189
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
Unit tests thermostats_test and random_test are very slow #3573
Comments
Concerning the runtime: I chose the number of samples to remain below the 15 sec mark in Debug builds. I found out today that Debug builds don't get their |
Yes, this can also be easily fixed. E.g. replacing |
We need to weigh in on the importance of fixing those tests in the context of using |
Yes I think so. That is basically turning on all the optimizations that are still compatible with coverage. I think |
Looking at the code, replacing the |
Removing the Depending on the unit test, between 30% and 50% of the runtime comes from the generation of random numbers. |
Description of changes: - Remove RNG correlation stemming from seed offsets (fixes #3585) - seeds are now used as keys - a monotonically increasing counter is used in each thermostat - the only way to reset these counters is to create a new `System` - Remove RNG correlation stemming from resetting `sim_time` or `time_step` during simulations with SD (fixes #3840) - the SD thermostat now uses the same RNG interface as other thermostats - Accelerate RNG unit tests (fixes #3573) - they now take 2 seconds to run in coverage and sanitizer builds in CI - Separate thermostats from integrators - better separation of concerns
in debug builds. This is due to the use of heap allocations and std::functions in the how loop.
With a better implementation these tests can be considerably sped up, which would lead to
a smoother workflow.
We should also discuss if statistical tests on the thermostats are needed or a good idea, or
if would be better if a mock RNG could be passed to then, and then checked if it is used correctly.
Also I'm not convinced that we should test the statistics of the RNG, I think it should rather be
tested that it implements philox correctly, e.g. checking that it produces the correct sequence
for a small set of parameters.
For reference, on my AMD Ryzen Threadripper 1920X, the tests take:
The text was updated successfully, but these errors were encountered: