A SCALABLE LIBRARY FOR PSEUDORANDOM NUMBER GENERATION ALGORITHM 806: SPRNG.

Slides:



Advertisements
Similar presentations
PARALLEL RANDOM NUMBER GENERATION
Advertisements

Idan Zaguri Ran Tayeb 2014 Parallel Random Number Generator.
High Performance Computing 1 Random Numbers. High Performance Computing 1 What is a random number generator? Most random number generators generate a.
Modular Programming With Functions
Generating Random Numbers
Case study 1: Calculate the approximation of Pi
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
Random Numbers. Two Types of Random Numbers 1.True random numbers: True random numbers are generated in non- deterministic ways. They are not predictable.
CDA6530: Performance Models of Computers and Networks Chapter 5: Generating Random Number and Random Variables TexPoint fonts used in EMF. Read the TexPoint.
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
Simulation Where real stuff starts. ToC 1.What, transience, stationarity 2.How, discrete event, recurrence 3.Accuracy of output 4.Monte Carlo 5.Random.
Using random numbers Simulation: accounts for uncertainty: biology (large number of individuals), physics (large number of particles, quantum mechanics),
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 5 - Functions Outline 5.1Introduction 5.2Program.
Genetic Algorithms Can Be Used To Obtain Good Linear Congruential Generators Presented by Ben Sproat.
Pseudorandom Number Generators
Statistics.
 2007 Pearson Education, Inc. All rights reserved C Functions.
Random Number Generation
K. Desch – Statistical methods of data analysis SS10
 2007 Pearson Education, Inc. All rights reserved C Functions.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
CSCE Monte Carlo Methods When you can’t do the math, simulate the process with random numbers Numerical integration to get areas/volumes Particle.
Random-Number Generation. 2 Properties of Random Numbers Random Number, R i, must be independently drawn from a uniform distribution with pdf: Two important.
Random Number Generation Fall 2013
Efficient Pseudo-Random Number Generation for Monte-Carlo Simulations Using GPU Siddhant Mohanty, Subho Shankar Banerjee, Dushyant Goyal, Ajit Mohanty.
1 Pseudorandom Number Generators and the Metropolis Algorithm Jane Ren.
Random Number Generation Pseudo-random number Generating Discrete R.V. Generating Continuous R.V.
ETM 607 – Random Number and Random Variates
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
Random Number Generators CISC/QCSE 810. What is random? Flip 10 coins: how many do you expect will be heads? Measure 100 people: how are their heights.
FALL 2001ICOM Lecture 21 ICOM 4015 Advanced Programming Lecture 2 Procedural Abstraction Reading: LNN Chapter 4, 14 Prof. Bienvenido Velez.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. C How To Program - 4th edition Deitels Class 05 University.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.
CS433 Modeling and Simulation Lecture 15 Random Number Generator Dr. Anis Koubâa 24 May 2009 Al-Imam Mohammad Ibn Saud Islamic University College Computer.
© 2003, Carla Ellis Simulation Techniques Overview Simulation environments emulation exec- driven sim trace- driven sim stochastic sim Workload parameters.
CPSC 531: RN Generation1 CPSC 531:Random-Number Generation Instructor: Anirban Mahanti Office: ICT Class Location:
Chapter 7 Random-Number Generation
Module 1: Statistical Issues in Micro simulation Paul Sousa.
Basic Concepts in Number Theory Background for Random Number Generation 1.For any pair of integers n and m, m  0, there exists a unique pair of integers.
Pseudorandom Number Generation on the GPU Myles Sussman, William Crutchfield, Matthew Papakipos.
Modeling and Simulation Random Number Generators
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
Pseudo-random generators Random Number Generating There are three types of generators table look-up generators hardware generators algorithmic (software)
Monte Carlo Methods.
Experimental Method and Data Process: “Monte Carlo Method” Presentation # 1 Nafisa Tasneem CHEP,KNU
Monte Carlo Methods So far we have discussed Monte Carlo methods based on a uniform distribution of random numbers on the interval [0,1] p(x) = 1 0  x.
APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.
Author: B. C. Bromley Presented by: Shuaiyuan Zhou Quasi-random Number Generators for Parallel Monte Carlo Algorithms.
Randomness Test Fall 2012 By Yaohang Li, Ph.D.. Review Last Class –Random Number Generation –Uniform Distribution This Class –Test of Randomness –Chi.
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
Random Number Generator. Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence.
Quasi-Random Number Sequences from a Long Period TLP Generator with Remarks on Application to Cryptography By Herbert S. Bright and Richard L. Enison Presented.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 5 - Functions Outline 5.1Introduction 5.2Program.
CS774. Markov Random Field : Theory and Application Lecture 15 Kyomin Jung KAIST Oct
R ANDOM N UMBER G ENERATORS Modeling and Simulation CS
Parallel Random Number Generation
Module 9.2 Simulations. Computer simulation Having computer program imitate reality, in order to study situations and make decisions Applications?
Chapter 3 Generating Uniform Random Variables. In any kind of simulation, we need data, or we have to produce them. Especially in Monte Marco simulation.
MONTE CARLO METHOD DISCRETE SIMULATION RANDOM NUMBER GENERATION Chapter 3 : Random Number Generation.
1.  How does the computer generate observations from various distributions specified after input analysis?  There are two main components to the generation.
Chapter INTRODUCTION Data Types and Arithmetic Calculations.
10.Deterministic Randomness 1.Random Sequences Random Sequences A sequence of numbers r 1, r 2,... is random if there are no discernible patterns.
Generating Random Numbers
Chapter 5 Function Basics
Parallel Programming in C with MPI and OpenMP
CS 475/575 Slide set 4 M. Overstreet Old Dominion University
Chapter 7 Random-Number Generation
Lecture 2 – Monte Carlo method in finance
Computing and Statistical Data Analysis Stat 3: The Monte Carlo Method
Computer Simulation Techniques Generating Pseudo-Random Numbers
Presentation transcript:

A SCALABLE LIBRARY FOR PSEUDORANDOM NUMBER GENERATION ALGORITHM 806: SPRNG

ABOUT: PSEUDO-RANDOM LIBRARIES Many Libraries Parameterization – based libraries Erroneous => Real world applications New Library – SPRNG Purpose of SPRNG ?

INTRODUCTION Problems: Erroneous => Monte Carlo Applications High Performance Cycles Parallelism – More Complicates Solution: SPRNG – Scalable and Distributed Architecture

PARALLEL PSEUDORANDOM-NUMBER GENERATION Methods - Parameterization Linear Congruential Generators: Commonly used generator Linear Recursion : Periodic Sequence

PRIME MODULUS

Exponential Sum: Full period Partially period Upper Bounds: Equidistributed Parallel: Exponential Sum Correlation is :

Upper Bound: Open Questions: Choosing ‘m’ ? A. Fast modular multiplication or fast calculation of jth integer Good intrastream correlation also ensure good intrastream independence to performance ? Hence  Such techniques are less attractive for parallel Pseudo random number generation.

LAGGED- FIBONACCI GENERATOR Previous: Varying parameters - recursion Now: Parameterized – Initial Value ALFG Equation: Popular : Serial and Scalable Parallel Machines Reasons: 1. Easy to implement 2. Cheap to compute It does well on statistical tests

Maximal Period : Template :

O(K*K) Template : Advantage: Optimal Disadvantage : No proof and improvement of this analytical is open challenge

Advantage: Good for Floating point However, care must be taken to maintain the uniqueness of the parallel streams

SPRNG Random Number streams to parallel processes Advantages: 1. Several, Distinct, Well tested, Scalable PRNGs 2. Initailization without Inter process communication 3. Reproducibility 4. Minimization of Interprocess correaltion 5. Uniformity 6. Integrated Test Suites 7. Extensibility

GENERATORS Additive lagged Fibonacci Multiplicative Lagged Fibonacci Prime Modules Multiplicative Congruential Power-of-two modules linear Congruential Combined Multiplicative Recursive generator

EXAMPLES Download: Definition : init_sprng routine int *init_sprng(int streamnum, int nstreams, int seed, int param)

#include #define SIMPLE_SPRNG/* simple interface */ #include "sprng.h" /* SPRNG header file */ using namespace std; int main() { double rn; int i; printf(" Printing 3 random numbers in [0,1):\n"); for (i=0;i<3;i++) { rn = sprng();/* generate double precision random number */ printf("%f\n",rn); } return 0; }

EXECUTION $>./simple-simple Printing 3 random numbers in [0,1):

SPRNG TEST SUITE Intrastream Correlation Interstream Correlation Statistical Test

Example: test.lib nstreams ncombine seed param nblocks skip Ex: eqi-distance.lcg mpirun -np 2 equidistnce.lcg Result: mpirun -np 2 eqidist.lcg eqidistance.lcg KS value : KS value prob : Hence, It is b/w 2.5% and 97.5% It is passed

There are different tests that are described by Knuth are described in SPRNG library such as Collision tests Coupons Collector tests Equidistance tests Gap test Permutation tests Poker tests Serial test

PHYSICALLY BASED TESTS: Ising Model : Random Walk Test:

CONCLUSION Comprehensive Library Recursions are simple Reusable Extensibility Uniformity : C, C++, MPI and FORTRAN

REFERENCES ng/implement.shtml ng/implement.shtml how=s4.6 how=s4.6