User's Guide:Installation

Next:Platforms Previous:Introduction


SPRNG 4.0 Installation

Obtaining SPRNG source code

SPRNG is available as a compressed tar file. In order to obtain the source code, please perform the following steps:

  1. Download the file sprng4.0.tar.gz to the location where you wish to place the source code.
  2. In the directory where you have copied the file sprng4.0.tar.gz, execute the following command:

    zcat sprng4.0.tar.gz | tar xovf -

A directory called sprng will be created, along with its subdirectories. sprng4.0 is the main SPRNG directory. In order to continue with the rest of the installation, please change to the directory sprng4.0 by executing the following command:

cd sprng4.0

SPRNG organization

The main SPRNG directory, sprng, contains the following subdirectories:

  1. SRC contains the source code for the SPRNG libraries. The code for each generator is in a separate subdirectory. Code common to all the generators is in the SRC directory itself.
  2. EXAMPLES contains example C++ and FORTRAN programs that demonstrate the use of the SPRNG libraries.
  3. DOCS contains SPRNG documentations as a compressed tar file of several html documents. Please uncompress and untar them and see the toc.html file for the rest of the links. The SPRNG home page has links to the updated version of this documentation.
  4. TESTS contains source code for routines that test the quality of the random number generators.
  5. lib The SPRNG random number libraries will be placed here by default when you compile them.
  6. include The SPRNG header files are located here.

Building the SPRNG libraries

In order to build the SPRNG libraries, the example programs and the executables that test the quality of the random number generators, please edit the file make.CHOICES

The make.CHOICES file looks like this:

 
#PLAT = CONVEX 
PLAT = SGI 
#PLAT = SP2 
#PLAT = T3E 

If users wish to build SPRNG on the HP/Convex Exemplar, then they should comment out the line specifying the SGI and uncomment the line specifying the CONVEX as follows:

 
PLAT = CONVEX 
#PLAT = SGI 
#PLAT = SP2 
#PLAT = T3E 

Then, the make command will build the libraries using the compiler options set in the file SRC/make.CONVEX. The user may wish to edit this file if a different compiler or different compiler options are wanted. In particular, if a FORTRAN 77 compiler or ranlib is not available, please set F77 or RANLIB to 'echo' respectively.

Currently SPRNG has been tested on CRAY T3E, HP/CONVEX Exemplar, IBM SP2, SGI-CRAY Origin 2000 and SGI Power Challenge parallel computers. It has also been ported to HP and SUN workstations and PC running Linux. Please read the notes on the makefile to port SPRNG to other machines.

Alternatively, the subdirectories can be built individually by executing the make command in the desired subdirectory.

The compilation process includes a file called make.platform, depending on the platform. We have set certain variables based on their setting on our systems. If they differ on your system, please see our explanation for the makefile and make suitable changes.

By default, the SPRNG libraries are placed in the lib sub-directory. Along with the libraries, certain executables for timing the generators and for checking whether the generators ported correctly placed in the main sprng directory.

Checking the libraries

Once the SPRNG library has been built, the user should check that the library has indeed ported correctly. If you are using MPI, you need to go directory SRC and uncomment the line #define USE_MPI in both check_gen.cpp and check_gen_simple.cpp. Please execute the following command in the directory sprng:

./checksprng

The output will give the results for the different SPRNG libraries and interfaces. All the tests should be PASSED. If any of the test FAILS, then SPRNG has not ported correctly. Please report this problem to us.

Timing the libraries

The user can check the speed of the different SPRNG random number generators by executing the following command in the directory sprng:

./timesprng

The output will give the time taken for generating a million random numbers, and also the number of random numbers generated per second, expressed in MRS (Million Random numbers per Second).


[Quick Start] [User's Guide] [Reference Manual] [Quick Reference] [Next: Platforms]