User and Programmers Guide to the Neutron Ray-Tracing Package McStas, version 3.8.6

A.2  Random generator

As of McStas 3.x, the default random number generator is a 64-bit adaptation of Marsaglia’s KISS (“Keep It Simple Stupid”) generator, a composite of a linear congruential generator, a xorshift generator, and a multiply-with-carry generator, combined to give a very long period (\(>2^{127}\)) while remaining fast and simple. Crucially, KISS runs identically on both CPU and GPU/OpenACC, which is why it replaced the previously used Mersenne Twister as the default: Mersenne Twister’s large internal state does not parallelize well and is currently not functional for GPU-accelerated simulations (section 3.5.3).

The classic "Mersenne Twister" generator, by Makoto Matsumoto and Takuji Nishimura (see
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html for the original source), remains available as a build-time alternative for CPU-only simulations, selected by compiling the generated instrument with -DRNG_ALG=1 (e.g. via the MCSTAS_CFLAGS environment variable, or mcstas’s C-compiler flag options). It has an extremely large period (\(2^{19937}-1\)) and negligible cross-correlations up to 623 dimensions, but should not be selected for GPU/OpenACC runs.