Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] aeit_v2_0.tar.gz(1726 Kbytes)
Manuscript Title: RNGSSELIB: Program library for random number generation. More generators, parallel streams of random numbers and Fortran compatibility.
Authors: L.Yu. Barash, L.N. Shchur
Program title: RNGSSELIB
Catalogue identifier: AEIT_v2_0
Distribution format: tar.gz
Journal reference: Comput. Phys. Commun. 184(2013)2367
Programming language: C, Fortran.
Computer: PC, laptop, workstation, or server with Intel or AMD processor.
Operating system: Unix, Windows.
RAM: 4 Mbytes
Keywords: Statistical methods, Monte Carlo, Random numbers, Pseudorandom numbers, Random number generation, Streaming SIMD Extensions.
PACS: 02.70.Uu, 02.50.Ng, 05.45.-a.
Classification: 4.13.

Does the new version supersede the previous version?: Yes

Nature of problem:
Any calculation requiring uniform pseudorandom number generator, in particular, Monte Carlo calculations. Any calculation requiring parallel streams of uniform pseudorandom numbers.

Solution method:
The library contains realization of the following modern and reliable generators: MT19937 [2], MRG32K3A [3], LFSR113 [4], GM19, GM31, GM61 [1], and GM29, GM55, GQ58.1, GQ58.3, GQ58.4 [5, 6]. The library contains both usual realizations and realizations based on SSE command set. Usage of SSE commands allows for substantially improved performance of all generators. Also, the updated library contains the abilities to jump ahead inside RNG sequence and to initialize independent random number streams with block splitting method for each of the RNGs.

Reasons for new version:
  1. In order to implement Monte Carlo calculations, the implementation of independent streams of random numbers is necessary. Such implementation of initializing random number streams with block splitting method is added to the new version for each of the RNGs. Jumping ahead inside RNG sequence, which is necessary for the block splitting method, was also added for each of the RNGs.
  2. Users asked us to add Fortran compatibility to the library.
    Fortran compatibility and the examples of using the library in Fortran for each of the RNGs are included in this version.
  3. During last few years, the method of random number generation based on using the ensemble of transformations of two-dimensional torus, was essentially improved [5, 6]. Important properties, such as high-dimensional equidistribution, were established for the RNGs of this type. The proper choice of parameters was determined, which resulted in the validity of the high-dimensional equidistribution property, and, correspondingly, the new high-quality RNGs GM29, GM55.4, GQ58.1, GQ58.3, GQ58.4 were proposed. These RNGs are included now in the RNGSSELIB library.

Summary of revisions:
  1. We added Fortran compatibility and examples of using the library in Fortran for each of the generators.
  2. New modern and reliable generators GM29, GM55.4, GQ58.1, GQ58.3, GQ58.4, which were introduced in [5] were added to the library.
  3. The ability to jump ahead inside RNG sequence and to initialize independent random number streams with block splitting method are added for each of the RNGs.

Restrictions:
For SSE realizations of the generators, Intel or AMD CPU supporting SSE2 command set is required. In order to use the SSE realization for the lfsr113 generator, CPU must support SSE4.1 command set.

Additional comments:
The function call interface has been slightly modified compared to the previous version in order to support Fortran compatibility. For each of the generators, RNGSSELIB supports the following functions, where rng should be replaced by the particular name of the RNG:

void rng_skipahead_(rng_state* state, unsigned long long offset);
void rng_init_(rng_state* state);
void rng_init_sequence_(rng_state* state,unsigned long long SequenceNumber);
unsigned int rng_generate_(rng_state* state);
float rng_generate_uniform_float_(rng_state* state);
unsigned int rng_sse_generate_(rng_sse_state* state);
void rng_get_sse_state_(rng_state* state,rng_sse_state* sse_state);
void rng_print_state_(rng_state* state);
void rng_print_sse_state_(rng_sse_state* state);

However, there are a few peculiarities for some of the RNGs. The detailed function call interface and the corresponding comments can be found in the header files of the include directory. The examples of using the library can be found in the examples directory.
The algorithms used to jump ahead in the RNG sequence and to initialize parallel streams of pseudorandom numbers are described in detail in [7] and in [8].

A GPU/CUDA version of this program is available in the Library, Catalogue Id. AESB_v1_0 (PRAND).

This work was supported by Russian Foundation for Basic Research and by the Supercomputing Center of Lomonosov Moscow State University [9].

Running time:
Running time is of the order of 20 sec for generating 109 pseudorandom numbers with a PC based on Intel Core i7-940 CPU. Running time is analyzed in detail in [1] and in [5].

References:
[1] L.Yu Barash, L.N. Shchur, RNGSSELIB: Program library for random number generation, SSE2 realization, Computer Physics Communications, 182 (7), 1518-1527 (2011).
[2] M. Matsumoto and T. Tishimura, Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator, ACM Trans. on Mod. and Comp. Simul. 8 (1), 3-30 (1998).
[3] P. L'Ecuyer, Good Parameter Sets for Combined Multiple Recursive Random Number Generators, Oper. Res. 47 (1), 159-164 (1999).
[4] P. L'Ecuyer, Tables of Maximally-Equidistributed Combined LFSR Generators, Math. of Comp., 68 (255), 261-269 (1999).
[5] L.Yu. Barash, Applying dissipative dynamical systems to pseudorandom number generation: Equidistribution property and statistical independence of bits at distances up to logarithm of mesh size, Europhysics Letters (EPL) 95, 10003 (2011).
[6] L.Yu. Barash, Geometric and statistical properties of pseudorandom number generators based on multiple recursive transformations //Springer Proceedings in Mathematics and Statistics, Springer-Verlag, Berlin, Heidelberg, Vol. 23, 265280 (2012).
[7] L.Yu. Barash, L.N. Shchur, On the generation of parallel streams of pseudorandom numbers, Programmnaya inzheneriya, 1 (2013) 24 (in Russian)
[8] L.Yu. Barash, L.N. Shchur, PRAND: GPU accelerated parallel random number generation library, submitted to Comp. Phys. Commun. (2013).
[9] Voevodin Vl.V., Zhumatiy S.A., Sobolev S.I., Antonov A.S., Bryzgalov P.A., Nikitenko D.A., Stefanov K.S., Voevodin Vad.V., Practice of "Lomonosov" Supercomputer // Open Systems J. - Moscow: Open Systems Publ., 2012, no.7. (In Russian)