Colloquium 2023 p2rng – A C++ Parallel Random Number Generator Library for the Masses
p2rng (https://github.com/arminms/p2rng) is a modern header-only C++ library for parallel algorithmic (pseudo) random number generation supporting OpenMP, CUDA, ROCm and oneAPI. Playing fair, mostly required for debugging and unit testing, is one of the unique features of p2rng. That means using the same seed and distribution you always get the same sequence of random numbers on all supported platforms. p2rng provides parallel versions of STL’s std::generate() and std::generate_n() algorithms with the same interface. In this seminar we first start with a quick review of preliminary concepts about algorithmic random number generators in general and parallelization techniques in particular. Then we continue with the standard way of generating random numbers with STL algorithms and how we can turn them into parallel version using p2rng.