Skip to main content

Advertisement

Log in

Employing AVX vectorization to improve the performance of random number generators

  • Published:
Programming and Computer Software Aims and scope Submit manuscript

Abstract

By the example of the RNGAVXLIB random number generator library, this paper considers some approaches to employing AVX vectorization for calculation speedup. The RNGAVXLIB library contains AVX implementations of modern generators and the routines allowing one to initialize up to 1019 independent random number streams. The AVX implementations yield exactly the same pseudorandom sequences as the original algorithms do, while being up to 40 times faster than the ANSI C implementations.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Explore related subjects

Discover the latest articles, news and stories from top researchers in related subjects.

References

  1. Beach, K.S.D., Lee, P.A., and Monthoux, P., Fieldinduced antiferromagnetism in the Kondo insulator, Phys. Rev. Lett., 2004, vol. 92, no.2.

    Google Scholar 

  2. Binder, K. and Heerman, D.W., Monte Carlo Simulation in Statistical Physics: An Introduction, Springer, 2010, 5th ed.

    Book  Google Scholar 

  3. Landau, D.P. and Binder, K., A Guide to Monte–Carlo Simulations in Statistical Physics, Cambridge Univ. Press, 2000.

    MATH  Google Scholar 

  4. Pieper, S.C. and Wiring, R.B., Quantum Monte–Carlo calculations of light nuclei, Ann. Rev. Nucl. Part. Sci., 2001, vol. 51, pp. 53–90.

    Article  Google Scholar 

  5. Luchow, A. and Anderson, J.B., Monte–Carlo methods in electronic structures for large molecules, Ann. Rev. Phys. Chem., 2000, vol. 51, pp. 501–526.

    Article  Google Scholar 

  6. Bizzarri, A.R., Neutron scattering and molecular dynamics simulation: A conjugate approach to investigate the dynamics of electron transfer proteins, J. Phys.: Cond. Mat., 2004, vol. 16, no. 4, pp. R83–R110.

    Google Scholar 

  7. Lehmer, D.H., Mathematical methods in large-scale computing units, Proc. Second Symp. on Large-Scale Digital Calculating Machinery, Cambridge, 1951, pp. 141–146.

    Google Scholar 

  8. Coveyou, R.R. and MacPherson, R.D., Fourier analysis of uniform random number generators, J. Assoc. Comput. Mach., 1967, vol. 14, pp. 100–119.

    Article  MathSciNet  MATH  Google Scholar 

  9. Marsaglia, G., Random numbers fall mainly in the planes, Proc. Nat. Acad. Sci. USA, 1968, vol. 61, pp. 25–28.

    Article  MathSciNet  MATH  Google Scholar 

  10. Golomb, S.W., Shift Register Sequences, San Francisco: Holden-Day, 1967.

    MATH  Google Scholar 

  11. Shchur, L.N., On the quality of random number generators with taps, Comput. Phys. Commun., 1999, nos. 121–122, pp. 83–85.

    Article  MathSciNet  Google Scholar 

  12. Ferrenberg, A.M., Landau, D.P., and Wong, Y.J., Monte–Carlo simulations: Hidden errors from “good” random number generators, Phys. Rev. Lett., 1992, vol. 69, no.23.

    Google Scholar 

  13. Selke, W., Talapov, A.L., and Shchur, L.N., Clusterflipping Monte–Carlo algorithm and correlation in “good” random number generators, JETP Lett., 1993, vol. 58, p.665.

    MathSciNet  Google Scholar 

  14. Grassberger, P., On correlations in “good” random number generators, Phys. Lett. A, 1993, vol. 181, pp. 43–46.

    Article  Google Scholar 

  15. Vattulainen, I., Ala-Nissila, T., and Kankaala, K., Physical tests for random numbers in simulations, Phys. Rev. Lett., 1994, vol. 73, pp. 2513–2516.

    Article  Google Scholar 

  16. Schmid, F. and Wilding, N.B., Errors in Monte–Carlo simulations using shift register random number generators, Int. J. Modern Phys. C, 1995, vol. 6, pp. 781–797.

    Article  Google Scholar 

  17. Shchur, L.N., Heringa, J.R., and Bloete, H.W.J., Simulations of a directed random-walk model: The effect of pseudo-random-number-correlations, Physica A, 1997, vol. 241, pp. 579–592.

    Article  Google Scholar 

  18. Shchur, L.N. and Bloete, H.W.J., Cluster Monte–Carlo: Scaling of systematic errors in 2D Ising model, Phys. Rev. E, 1997, vol. 55, pp. R4905–R4908.

    Article  Google Scholar 

  19. L’Ecuyer, P., Random number generation, in Handbook on Simulation, Banks, J., Ed., Wiley, 1998, pp. 93–137.

    Chapter  Google Scholar 

  20. L’Ecuyer, P. and Simard, R., TestU01: A C library for empirical testing of random number generators, ACM TOMS, 2007, vol. 33, no.4.

    Google Scholar 

  21. Matsumoto, M. and Nishimura, T., Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator, ACM Trans. Mod. Comp. Simul, 1998, vol. 8, no. 1, pp. 3–30.

    Article  MATH  Google Scholar 

  22. L’Ecuyer, P., Good parameter sets for combined multiple recursive random number generators, Oper. Res, 1999, vol. 47, no. 1, pp. 159–164.

    Article  MATH  Google Scholar 

  23. L’Ecuyer, P., Maximally equidistributed combined Tausworthe generators, Math. Comp., 1996, vol. 65, no. 213, pp. 203–213.

    Article  MathSciNet  MATH  Google Scholar 

  24. L’Ecuyer, P., Tables of maximally-equidistributed combined LFSR generators, Math. Comp., 1999, vol. 68, no. 255, pp. 261–269.

    Article  MathSciNet  MATH  Google Scholar 

  25. Barash, L.Yu., Applying dissipative dynamical systems to pseudorandom number generation: Equidistribution property and statistical independence of bits at distances up to logarithm of mesh size, Europhys. Lett., 2011, vol. 95, pp. 10003–10008.

    Article  Google Scholar 

  26. Barash, L. and Shchur, L.N., Periodic orbits of the ensemble of Sinai–Arnold cat maps and pseudorandom number generation, Phys. Rev. E 2006, vol. 73, 036701.

    Article  MathSciNet  Google Scholar 

  27. Barash, L. and Shchur, L.N., RNGSSELIB: Program library for random number generation, SSE2 realization, Comput. Phys. Commun., 2011, vol. 182, no. 7, pp. 1518–1527.

    Article  MathSciNet  MATH  Google Scholar 

  28. Barash, L.Yu. and Shchur, L.N., Hyperbolic toral automorphisms and pseudorandom number generators: Implementations based on SSE instructions, Trudy Seminara po vychislitel’nym tekhnologiyam v estestvennykh naukakh, vyp. 1. Vychislitel’naya fizika (Proc. Workshop on Computational Technologies in Natural Sciences, Series 1: Computational Physics), Nazirov, R.R, Ed., Moscow: Izd. KDU, 2009, pp. 14–29.

    Google Scholar 

  29. Barash, L.Yu., Geometric and statistical properties of pseudorandom number generators based on multiple recursive transformations, Springer Proceedings in Mathematics and Statistics, Springer, 2012, vol. 23, pp. 265–280.

    Article  MathSciNet  MATH  Google Scholar 

  30. Barash, L.Yu. and Shchur, L.N., RNGSSELIB: Program library for random number generation. More generators, parallel streams of random numbers, and Fortran compatibility, Comput. Phys. Commun., 2013, vol. 184, no. 10, pp. 2367–2369.

    Article  Google Scholar 

  31. L’Ecuyer, P., Uniform Random Number Generation, Ann. Oper. Res., 1994, vol. 53, pp. 77–120.

    Article  MathSciNet  MATH  Google Scholar 

  32. Salmon, J.K., Moraes, M.A., Dror, R.O., and Show, D.E., Parallel random numbers: As easy as 1, 2, 3, Proc. Int. Conf. High Performance Computing, Networking, Storage, and Analysis, New York, 2011, pp. 1–12.

    Google Scholar 

  33. Manssen, M., Weigel, M., and Hartmann, A.K., Random number generators for massively parallel simulations on GPU, Eur. Phys. J.: Spec. Top., 2012, vol. 210, no. 1, pp. 53–71.

    Google Scholar 

  34. Guskova, M.S., Barash, L.Yu., and Shchur, L.N., RNGAVXLIB: Program library for random number generation, AVX realization, Comput. Phys. Commun., 2016, vol. 200, pp. 402–405.

    Article  MATH  Google Scholar 

  35. Intel 64 and IA-32 Architectures Software Developer’s Manual, vol. 2 (2A, 2B, 2C). https://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html.

  36. Barash, L.Yu. and Shchur, L.N., About generation of parallel streams of pseudorandom numbers, Program. Inzheneriya, 2013, no. 1, pp. 24–32.

    Google Scholar 

  37. Galassi, M., et al., GNU Scientific Library Reference Manual, Network Theory Ltd., 2009, 3rd ed.

    Google Scholar 

  38. Intel Math Kernel Library Reference Manual, 2007. https://www.intel.com/cd/software/products/emea//rus/358888.htm.

  39. Mascagni, M. and Srinivasan, A., Algorithm 806: SPRNG: A scalable library for pseudorandom number generation, ACM Trans. Math. Software, 2000, vol. 26, pp. 436–461.

    Article  Google Scholar 

  40. Bauke, H., Tina’s random number generator library, 2011. http://www.numbercrunch.de/trng.

    Google Scholar 

  41. Barash, L.Yu. and Shchur, L.N., Generating random numbers and parallel random number streams for Monte–Carlo calculations, Model. Anal. Inf. Sist., 2012, vol. 19, no. 2, pp. 145–162.

    Google Scholar 

  42. Bauke, H. and Mertens, S., Random numbers for large-scale distributed Monte–Carlo simulations, Phys. Rev. E, 2007.

    Google Scholar 

  43. Shchur, L.N. and Butera, P., The RANLUX generator: Resonances in a random walk test, Int. J. Mod. Phys, 1998, vol. 4, no. 9, pp. 607–624.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to L. Yu. Barash.

Additional information

Original Russian Text © L.Yu. Barash, M.S. Guskova, L.N. Shchur, 2017, published in Programmirovanie, 2017, Vol. 43, No. 3.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Barash, L.Y., Guskova, M.S. & Shchur, L.N. Employing AVX vectorization to improve the performance of random number generators. Program Comput Soft 43, 145–160 (2017). https://doi.org/10.1134/S0361768817030033

Download citation

  • Received:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1134/S0361768817030033

Navigation