Access and Usage of SPRNG on JUROPA

On JUROPA version 1.0 as well as version 2.0 of SPRNG is installed. There are sequential and parallel routines in SPRNG and there is a C as well as a FORTRAN interface. There are versions compiled with intel/11.1 and versions compiled with intel/12.0. To see which versions are available say

module   avail

To get the path to the library you want you have to say

module   load   sprng/1.0

for version 1.0 compiled with intel/11.1

module   load   sprng/2.0

for version 2.0 compiled with intel/11.1

module   unload   intel
module   unload   mkl
module   load   intel/12.0.3
module   load   sprng/1.0_intel12.0.3

for version 1.0 compiled with intel/12.0.3

module   unload   intel
module   unload   mkl
module   load   intel/12.0.3
module   load   sprng/2.0_intel12.0.3

for version 2.0 compiled with intel/12.0.3

There are six different libraries in sprng version 1.0, one for each random number generator.
In version 2.0 there is only one library and to choose the type of random number generator an additional variable is given to each routine.

Sequential C User Program
Compiling and linking a program name.c with calls to libcmrg.a from version 1.0 for example looks as follows:

icc  name.c  -I$SPRNG_ROOT/include   -L$SPRNG_ROOT/lib -lcmrg

Compiling and linking a program name.c with calls to libsprng.a (version 2.0) looks as follows:

icc  name.c -I$SPRNG_ROOT/include   -L$SPRNG_ROOT/lib   lsprng


Sequential Fortran User Program
As JUROPA is a 64-Bit machine remember to use 64-Bit Fortran pointers! sprng is compiled with -DPOINTER_SIZE=8 to get the correct pointers in the C source code.
Compiling and linking a program name.f with libcmrg.a from version 1.0 for example looks as follows:

ifort -I$SPRNG_ROOT/include  name.f -L$SPRNG_ROOT/lib   -lcmrg

Compiling and linking a program name.f with libsprng.a (version 2.0) looks as follows:

ifort   -I$SPRNG_ROOT/include  name.f -L$SPRNG_ROOT/lib  -lsprng


MPI-parallel C User Program
Compiling and linking a parallel program name.c with calls to libcmrg.a from version 1.0 for example looks as follows:

mpicc   -I$SPRNG_ROOT/include  name.c  -L$SPRNG_ROOT/lib   -lcmrg

Compiling and linking a parallel program name.c with calls to libsprng.a (version 2.0) looks as follows:

mpicc   -I$SPRNG_ROOT/include  name.c -L$SPRNG_ROOT/lib   -lsprng


MPI-parallel Fortran User Program
Compiling and linking a parallel program name.f with calls to libcmrg.a from version 1.0 for example looks as follows:

mpif90 -I$SPRNG_ROOT/include  name.f  -L$SPRNG_ROOT/lib   -lcmrg

Compiling and linking a parallel program name.f with calls to libsprng.a (version 2.0) looks as follows:

mpif90   -I$SPRNG_ROOT/include  name.f  -L$SPRNG_ROOT/lib   -lsprng

Examples
The directory /usr/local/sprng/1.0/EXAMPLES contains examples that illustrate the use of the sequential and the parallel SPRNG software version 1.0 in C and Fortran.

To compile and execute the sequential examples, the following commands are sufficient:

cp   -r   $SPRNG_ROOT/EXAMPLES   $HOME
cd   $HOME/EXAMPLES
make 

There is a sample batchseq which shows how to execute all the sequential examples. All the necessary input files are also provided. For more information read the header of the sources of the examples and the file README in EXAMPLES.

To compile and execute the parallel examples, the following commands are sufficient:

cp   -r   $SPRNG_ROOT/EXAMPLES   $HOME
cd   $HOME/EXAMPLES
make  mpi

There is a sample batchmpi which can be submitted by calling

msub   -l   nodes=1:ppn=4 batchmpi

to run all the parallel examples. All the necessary input files are also provided. For more information read the header of the sources of the examples and the file README in EXAMPLES.


The directory /usr/local/sprng/2.0/EXAMPLES contains examples that illustrate the use of the sequential and the parallel SPRNG software version 2.0 in C and Fortran.

To compile and execute the sequential examples, the following commands are sufficient:

cp   $SPRNG_ROOT/EXAMPLES/   $HOME
cd   $HOME
make  

There is a sample runexamples_serial which shows how to execute all the sequential examples. All the necessary input files are also provided. For more information read the header of the sources of the examples and the file README in EXAMPLES.

To compile and execute the parallel examples, the following commands are sufficient:

cp   $SPRNG_ROOT/EXAMPLES/   $HOME
cd   $HOME
make   mpi

There is a sample runexamples_mpi which can be submitted by calling

msub   -l   nodes=1:ppn=4 runexamples_mpi

to run all the parallel examples. All the necessary input files are also provided. For more information read the header of the sources of the examples and the file README in EXAMPLES.


last change 24.02.2011 | Math Admin | Print