sample MPI/c++ program to call the SPRNG library

The full program is runsprng.cpp. Lines illustrating use of the sprng library and MPI Send and Recv functions are shown below.




Output from the command [psiders@beowulf www]$ mpirun -np 6 runsprng

   Random number generator 0 (lfg)
   id:             1          2          3          4          5    
           0    0.44148    0.81419    0.67244    0.06508    0.04786
       20000    0.99797    0.78137    0.27664    0.50201    0.41230
       40000    0.39637    0.38296    0.86886    0.23288    0.71488
       60000    0.40581    0.47516    0.25676    0.11400    0.59770
       80000    0.00248    0.64053    0.95231    0.38301    0.10299
      100000    0.44026    0.31129    0.40963    0.80981    0.41615
   average      0.49995    0.49842    0.49934    0.49823    0.49905
   End of random number test output.
   0.047488 seconds elapsed on 5 workers for generator 0 (lfg).
   ........

Complete output is available in runsprng.log.


go back to SPRNG
go back to index