Guide to Random Number Generation in C++
summary
Argues that the ubiquitous Mersenne Twister default in <random> is a poor fit for large scientific parallel workloads and shows concrete alternatives: counter-based PRNG, specifically Random123 (Threefry, Philox) and AES-based variants, which are stateless, use a key+counter model, and give reproducible per-block streams across threads. Benchmarks and test-suite results claim higher BigCrush quality where MT sometimes fails, much lower memory footprint, constant-time skipping, and substantial speedups on CPU/GPU (paper from 2011 wins HPC awards); implementations exist and work.
AI-written summary · about
chapters (8)
- 0:00Introduction and speaker background
- 3:31C vs C++ random APIs
- 8:30Parallel random generation pitfalls
- 13:45Counter-based random generators
- 17:37Faster counter-based generators
- 21:19Random quality benchmarks
- 22:23Conclusion and future improvements
- 24:51Q&A session
related talks
01h 08m“What C++ Programmers Need to Know about Header <random>"
50mLeveraging Modern C++ in Quantitative Finance
05mC++ Sequential Considered Harmful
01h 22mBreaking Enigma With the Power of Modern C++
01h 08mTemplate Meta-State Machines, Madness and Shannon
01h 08mBetter Code: Concurrency
41mC++11 Metaprogramming Applied to Software Obfuscation
01h 28mAn Introduction to Multithreading in C++20
