Repeatability with Random Numbers Using Algorithmic Skeletons
Résumé
This article presents a solution to ensure repeatability at software level when using pseudorandom numbers in parallel computations. This is achieved automatically to ease the developer, without inducing performance loss compared to a manual approach thanks to template metaprogramming.
Based on the data flow mechanism proposed in a previous work to design and execute algorithmic skeletons, we automate the correct usage of Pseudorandom Number Generator (PRNG) streams. This mechanism makes it possible to assign a PRNG stream to any part of an algorithm, and reaching repeatability can be done by providing the same random number sequence to any parallelizable task, whether it is in a parallel run, regardless of the degree of parallelism, or in a sequential one. Parallelizable tasks can easily be identified within algorithmic skeletons as they provide information about each component of their structure, accessible at compile-time.
We illustrate our solution on a metaheuristic to solve an Operational Research (OR) problem that allows several levels of parallelism.
Origine | Fichiers produits par l'(les) auteur(s) |
---|