Repeatability with random numbers using algorithmic skeletons


This article presents a solution to ensure repeatability atsoftware level when using pseudorandom numbers in paral-lel computations. This is achieved automatically to ease thedeveloper, without inducing performance loss compared toa manual approach thanks to template metaprogramming.Based on the data flow mechanism proposed in a pre-vious work to design and execute algorithmic skeletons,we automate the correct usage of Pseudorandom NumberGenerator (PRNG) streams. This mechanism makes itpossible to assign a PRNG stream to any part of an algo-rithm, and reaching repeatability can be done by providingthe same random number sequence to any parallelizabletask, whether it is in a parallel run, regardless of the de-gree of parallelism, or in a sequential one. Parallelizabletasks can easily be identified within algorithmic skeletonsas they provide information about each component of theirstructure, accessible at compile-time.We illustrate our solution on a metaheuristic to solvean Operational Research (OR) problem that allows severallevels of parallelism.

34th European Simulation and Modelling Conference (ESM)