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.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Beach, K.S.D., Lee, P.A., and Monthoux, P., Fieldinduced antiferromagnetism in the Kondo insulator, Phys. Rev. Lett., 2004, vol. 92, no.2.
Binder, K. and Heerman, D.W., Monte Carlo Simulation in Statistical Physics: An Introduction, Springer, 2010, 5th ed.
Landau, D.P. and Binder, K., A Guide to Monte–Carlo Simulations in Statistical Physics, Cambridge Univ. Press, 2000.
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.
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.
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.
Lehmer, D.H., Mathematical methods in large-scale computing units, Proc. Second Symp. on Large-Scale Digital Calculating Machinery, Cambridge, 1951, pp. 141–146.
Coveyou, R.R. and MacPherson, R.D., Fourier analysis of uniform random number generators, J. Assoc. Comput. Mach., 1967, vol. 14, pp. 100–119.
Marsaglia, G., Random numbers fall mainly in the planes, Proc. Nat. Acad. Sci. USA, 1968, vol. 61, pp. 25–28.
Golomb, S.W., Shift Register Sequences, San Francisco: Holden-Day, 1967.
Shchur, L.N., On the quality of random number generators with taps, Comput. Phys. Commun., 1999, nos. 121–122, pp. 83–85.
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.
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.
Grassberger, P., On correlations in “good” random number generators, Phys. Lett. A, 1993, vol. 181, pp. 43–46.
Vattulainen, I., Ala-Nissila, T., and Kankaala, K., Physical tests for random numbers in simulations, Phys. Rev. Lett., 1994, vol. 73, pp. 2513–2516.
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.
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.
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.
L’Ecuyer, P., Random number generation, in Handbook on Simulation, Banks, J., Ed., Wiley, 1998, pp. 93–137.
L’Ecuyer, P. and Simard, R., TestU01: A C library for empirical testing of random number generators, ACM TOMS, 2007, vol. 33, no.4.
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.
L’Ecuyer, P., Good parameter sets for combined multiple recursive random number generators, Oper. Res, 1999, vol. 47, no. 1, pp. 159–164.
L’Ecuyer, P., Maximally equidistributed combined Tausworthe generators, Math. Comp., 1996, vol. 65, no. 213, pp. 203–213.
L’Ecuyer, P., Tables of maximally-equidistributed combined LFSR generators, Math. Comp., 1999, vol. 68, no. 255, pp. 261–269.
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.
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.
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.
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.
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.
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.
L’Ecuyer, P., Uniform Random Number Generation, Ann. Oper. Res., 1994, vol. 53, pp. 77–120.
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.
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.
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.
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.
Barash, L.Yu. and Shchur, L.N., About generation of parallel streams of pseudorandom numbers, Program. Inzheneriya, 2013, no. 1, pp. 24–32.
Galassi, M., et al., GNU Scientific Library Reference Manual, Network Theory Ltd., 2009, 3rd ed.
Intel Math Kernel Library Reference Manual, 2007. https://www.intel.com/cd/software/products/emea//rus/358888.htm.
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.
Bauke, H., Tina’s random number generator library, 2011. http://www.numbercrunch.de/trng.
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.
Bauke, H. and Mertens, S., Random numbers for large-scale distributed Monte–Carlo simulations, Phys. Rev. E, 2007.
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.
Author information
Authors and Affiliations
Corresponding author
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
About this article
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
Received:
Published:
Issue Date:
DOI: https://doi.org/10.1134/S0361768817030033