Saturday, March 5, 2011

Parallelization of SOBOL Quasi Random Number Generator

Sobol Quasi Random Number Generaotors

Sobol Quasi Random Number Generaotors (sobol QRNG) are pseudo random number generators. There are often applications, for example in financial engineering, where random numbers are to be generated within an upper and lower limit. The main requirement of the random numbers to be generated in these applications are that the random numbers must fill the N space more uniformly than uncorrelated random points.

The serial algorithm for Sobol QRNG can be found at
"Implementation of Sobol Quasi Random Number generator “sobseq()” Chapter 7.7, Numerical Recepies in C,"

I have used pthreads to parallelize the algorithm. The main idea is "Divide and Conquer". If 64000 patterns are to be generated by 4 threads then each thread generates 64000/4 = 16000 random numbers.

The catch is that each thread must be provided with an intial seed so that no two threads generate the same set of random numbers. How do u generate the seed? That is another big story.

Below you can find my detailed report on parallelizing the pseudo random number generator using pthreads.

Detailed Report :  Sobol QRNG parallelized version.

Useful References:
1.ALGORITHM 659 Implementing Sobol’s Quasirandom Sequence Generator PAUL BRATLEY and BENNETT L. FOX Universite de Montrkal .
2.Implementation of Sobol Quasi Random Number generator “sobseq()” Chapter 7.7, Numerical Recepies in C,
3.“A primer for Monte Carlo method by Sobol” 1994 CRC Press.Inc, ISBN 0-8493-8673-X.
4.Quasirandom Number Generators for Parallel Monte Carlo Algorithms , B. C. BROMLEY , 38,101–104 (1996) JOURNAL OF PARALLEL AND DISTRIBUTED COMPUTING.
5.Posix Threads Programming Tutorial,
6.Normalized distributions, Wikipedia,
7.Gray Code, Wikipedia,

It had been a good experience for me getting the feel of parallel programming. Save a few bugs, the program is running fine. Need to resolve the bugs asap :)
I feel good.

1 comment:

  1. Good article.Thanks for your sharing,i learn a lot from your post.There is a lot of very useful knowledge in your post.I enjoy reading it and hope to see more.Can you write more about this topic?I am very interested in it.Waiting for your new post.
    draw barcode within java