Abstract
High-performance streams of (pseudo) random numbers are crucial for the efficient implementation of countless stochastic algorithms, most importantly, Monte Carlo simulations and molecular dynamics simulations with stochastic thermostats. A number of implementations of random number generators has been discussed for GPU platforms before and some generators are even included in the CUDA supporting libraries. Nevertheless, not all of these generators are well suited for highly parallel applications where each thread requires its own generator instance. For this specific situation encountered, for instance, in simulations of lattice models, most of the high-quality generators with large states such as Mersenne twister cannot be used efficiently without substantial changes. We provide a broad review of existing CUDA variants of random-number generators and present the CUDA implementation of a new massively parallel high-quality, high-performance generator with a small memory load overhead.
Similar content being viewed by others
References
A.K. Hartmann, A Practical Guide to Computer Simulations (World Scientific, Singapore, 2009)
J.E. Gentle, Random number generation and Monte Carlo methods, 2nd edn. (Springer, Berlin, 2003)
J. von Neumann, J. Res. Nat. Bur. Stand. 12, 36 (1951)
G. Marsaglia, J. Mod. Appl. Stat. Meth. 2, 2 (2003)
G. Marsaglia, DIEHARD Battery of Tests of Randomness, http://www.stat.fsu.edu/pub/diehard/
P. L’Ecuyer, R. Simard, ACM Trans. Math. Softw. 33, 4 (2007)
A.M. Ferrenberg, D.P. Landau, Y.J. Wong, Phys. Rev. Lett. 69, 3382 (1992)
G. Parisi, F. Rapuano, Phys. Lett. B 157, 301 (1985)
A.E. Ferdinand, M.E. Fisher, Phys. Rev. 185, 832 (1969)
J.D. Owens, M. Houston, D. Luebke, et al., Proc. IEEE 96, 879 (2008)
T. Preis, P. Virnau, W. Paul, et al., J. Comput. Phys. 228, 4468 (2009)
J. Yin, D.P. Landau, Phys. Rev. E 80, 051117 (2009)
M. Weigel, Comput. Phys. Commun. 182, 1833 (2011)
E.E. Ferrero, J.P. De Francesco, N. Wolovick, et al., Comput. Phys. Commun. 183, 1578 (2012)
T. Yavors’kii, M. Weigel, Eur. Phys. J. Special Topics 210, 159 (2012)
J.A. van Meel, A. Arnold, D. Frenkel, et al., Mol. Simul. 34, 259 (2008)
A.J. Anderson, C.D. Lorenz, A. Travesset, J. Comput. Phys. 227, 5342 (2008)
D.B. Kirk, W.W. Hwu, Programming Massively Parallel Processors (Elsevier, Amsterdam, 2010)
R.P. Brent, in Proc. Fifth Australian Supercomputer Conference, 95–104 (Melbourne, 1992)
J.K. Salmon, M.A. Moraes, R.O. Dror, et al., in Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis, SC ’11 (ACM, New York, NY, USA, 2011)
M. Matsumoto, T. Nishimura, ACM Trans. Model. Comput. Simul. 8, 3 (1998)
NVIDIA Corporation, CUDA Toolkit 4.1 CURAND Guide (2012)
L. Howes, D.B. Thomas, in GPU Gems 3 (Addison-Wesley, Boston, 2007), p. 805
E. Alerstam, T. Svensson, S. Andersson-Engels, J. Biomed. Opt. 13, 060504 (2008)
M. Weigel, J. Comp. Phys. 231, 3064 (2012)
M. Saito, M. Matsumoto, Variants of Mersenne Twister Suitable for Graphic Processors (2010), preprint [arXiv:1005.4973]
V. Demchik, Comput. Phys. Commun. 182, 692 (2011)
N. Nandapalan, R.P. Brent, L.M. Murray, et al., Lect. Notes Comput. Sc. 7203, 609 (2012)
T. Bradley, J. du Toit, R. Tong, et al., in Hwu, ed., GPU Gems: Emerald Edition (Morgan Kaufman, Amsterdam, 2011), p. 231
G. Marsaglia, J. Stat. Softw. 8, 1 (2003)
D.E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd edn. (Addison-Wesley, Upper Saddle River, NJ, 1997)
P. L’Ecuyer, Math. Comput. 68, 249 (1999)
W.H. Press, S.A. Teukolsky, W.T. Vetterling, et al., Numerical Recipes: The Art of Scientific Computing, 3rd edn. (Cambridge University Press, Cambridge, 2007)
M. Weigel, Phys. Rev. E 84, 036709 (2011)
J. Kelling, G.Ódor, Phys. Rev. E 84, 061150 (2011)
G. Marsaglia, A. Zaman, Ann. Appl. Probab. 1, 462 (1991)
M. Lüscher, Comput. Phys. Commun. 79, 100 (1994)
F. Belletti, M. Cotallo, A. Cruz, et al., Comput. Phys. Commun. 178, 208 (2008)
G. Marsaglia, A. Zaman, W. Wan Tsang, Stat. Probabil. Lett. 9, 35 (1990)
F. Panneton, P.L’Ecuyer, ACM Trans. Model. Comput. Simul. 15, 346 (2005)
R.P. Brent, ANZIAM Journal 48, C188 (2007)
W.A. Stein, Sage Mathematics Software, The Sage Development Team (2011)
V.Shoup, NTL: A library for doing number theory (2008)
W.Trappe, L.C.Washington, Introduction to Cryptography with Coding Theory, 1st edn. (Prentice Hall, 2002)
P. Hellekalek, S. Wegenkittl, ACM Trans. Model. Comput. Simul. 13, 322 (2003)
Author information
Authors and Affiliations
Electronic supplementary material
Rights and permissions
About this article
Cite this article
Manssen, M., Weigel, M. & Hartmann, A.K. Random number generators for massively parallel simulations on GPU. Eur. Phys. J. Spec. Top. 210, 53–71 (2012). https://doi.org/10.1140/epjst/e2012-01637-8
Received:
Revised:
Published:
Issue Date:
DOI: https://doi.org/10.1140/epjst/e2012-01637-8