Use pseudo-random instead of random streams to intialize seeds
authorErik Lindahl <erik@kth.se>
Sat, 1 Feb 2014 12:46:30 +0000 (13:46 +0100)
committerErik Lindahl <erik@kth.se>
Sat, 1 Feb 2014 12:47:43 +0000 (13:47 +0100)
commit49f0a587a5ece5e7692e62259ab24d949be54fa8
tree138a33bb3888bb782595ddd751b7315e2663aac3
parentad101c5e3417c380a64e2c5f4d4f3a8043edf721
Use pseudo-random instead of random streams to intialize seeds

The /dev/random stream will block if enough entropy is not
present in the system. This has not historically been a problem,
but with the unit tests initializing dozens of new random number
generators the entropy pool becomes exhausted, and the tests
block 10-20 seconds before each cool quote call for recent gcc
versions on our Ubuntu versions. This is also a seriously bad
abuse of the system random stream on shared systems.
Since /dev/urandom (which does not block) should be sufficiently
random for everything apart from long-term cryptographic keys,
we should use this one instead and leave /dev/random alone.

This patch solves an issue problems where recent gcc versions
took several minutes to complete unit tests.

Change-Id: I4a8fcf7e302d94f5ec3c9715593fbfd257decdd9
src/gromacs/random/random.c