[Gate-users] Multiprocessing solved and possible bug
David Boersma
david.boersma at igp.uu.se
Wed Aug 2 12:10:36 CEST 2017
Hi Clemens,
Sorry that we did not respond to this more speedily.
Your diagnosis is almost correct, I think. In version 7.2 the 'auto'
random seed was initialized with '/dev/random' while in 8.0 we now use
'/dev/urandom'. The 'u' means "unblocking". The "/dev/random" device can
indeed block while it tries to collect sufficient "entropy" from the
system (temperature sensor, process IDs, times of various things, etc).
The "/dev/urandom" device is provided exactly to remedy this for cases
where "truly random" is not required and "pseudorandom" is good enough
(in Monte Carlo it usually is, in e.g. cryptography it sometimes is
not). There is a lot of instructive material (and lively debates)
available online about this topic, google for "/dev/random versus
/dev/urandom".
So yes, users of the 7.2 release should be aware of this issue, users of
release 8.0 and later don't have to worry about it.
If you do choose to specify seeds manually, be *very* careful to make
sure that each process gets a unique seed. If you make a mistake by
which you get the same seed for a large part of your processes, then the
results are no longer statistically independent, effectively wasting a
lot of CPU hours (and compromising the statistical properties of your
result if for some reason the problem is not noticed).
In some cases we actually do want to reuse the same random seed, e.g.
for some validation tests and for debugging (using the same seed can be
important for reproducing some rarely occurring error). I think it is
mainly for such purposes that we enable the manual seeding in GATE.
/David
Den 02/08/2017 kl. 11:11, skrev Clemens S.:
> Dear fellow Gate-users,
>
> I've contacted this mailing list several times because of problems with
> running multiple concurrent Gate simulations (Gate 7.2, Ubuntu 16.04,
> using Fixed Forced Detection). The simulations seemed to get stuck at
> the setup of the run, before simulating any photons and would only
> continue after 10 or more minutes.
>
> I now finally managed to get it working and possibly found a bug:
>
> I used the Mersenne Twister with the seed set to `auto` and the
> simulations got stuck at setup. When I switched to a user-input seed
> (hardcoded or via an alias), the simulations flew through setup and ran
> immediately.
>
> Although the documentation claims Gate uses the PID and unixtime to
> generate the `auto` seeds, maybe the processes get stuck reading from
> /dev/urandom or something.
>
> This information if FYI, so that you don't have the same problem.
>
> Kind regards
> Clemens Schmid
>
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>
More information about the Gate-users
mailing list