ComputationalRadiationPhysics / haseongpu

HASEonGPU: High performance Amplified Spontaneous Emission on GPU
http://www.hzdr.de/crp
Other
7 stars 4 forks source link

Try TinyMT instead of mersenne twister (RandomNumberGeneratorPolicy) #55

Open erikzenker opened 9 years ago

erikzenker commented 9 years ago

It would be nice to exchange the random number generator in a policy based fashion. For example the sobol rng of issue #4 or the fast random number generator from jeffrey kelling mentioned by @bussmann .

Some steps are necessary:

bussmann commented 9 years ago

Absolutely! Jeffrey seems to have something like this already.

slizzered commented 9 years ago

I agree that the RNG should be based on a policy-based design. Hoewever, I'm not in favor of TinyMT, at least from its description on the homepage: (higlighting by me)

The purpose of TinyMT is not to replace Mersenne Twister. TinyMT has far shorter period than Mersenne Twister. The merit of TinyMT is in its small size of the internal state of 127 bits, far smaller than 19937 of Mersenne Twister. The purpose of TinyMT may be used in a situation where large state generators such as Mersenne Twister are difficult to use.

The thing is, we don't have any problems with space so far, but a long period is very important (see Axel's comment in #4).

Of course, having the policy-based interface would still be a great thing, obviously. And once we have it, testing TinyMT might at least be interesting.