Use and properly initialize PRNG when hardware random number generation is not working
authorArtem Zhmurov <zhmurov@gmail.com>
Thu, 22 Oct 2020 16:22:25 +0000 (16:22 +0000)
committerAndrey Alekseenko <al42and@gmail.com>
Thu, 22 Oct 2020 16:22:25 +0000 (16:22 +0000)
commit371d11b527db5e7915e59f5e0c5c44ebaa2c7ed9
tree270a0c4b67e2b0a4db62bedbdaa6b15592abbe0e
parentcff1299f0799cda74455000c37ccd33c8b3b02d8
Use and properly initialize PRNG when hardware random number generation is not working

The bug with hardware random number generation can cause picking of cool quotes to freeze in an infinite loop on some Ryzen systems. This patch checks the system for the bug and falls back to PRNGs. Also, the initial fix did not seed the PRNG for seed creation properly. This caused different independent runs to use the same PRNG sequence on affected systems. This fixes the issue by using the the timer value to seed PRNG and also switches to MT PRNG for initial seeding.
src/gromacs/random/seed.cpp
src/gromacs/utility/coolstuff.cpp