Efficient Random Sampling - Parallel, Vectorized, Cache-Efficient, and Online

17 Oct 2016  ·  Peter Sanders, Sebastian Lamm, Lorenz Hübschle-Schneider, Emanuel Schrade, Carsten Dachsbacher ·

We consider the problem of sampling $n$ numbers from the range $\{1,\ldots,N\}$ without replacement on modern architectures. The main result is a simple divide-and-conquer scheme that makes sequential algorithms more cache efficient and leads to a parallel algorithm running in expected time $\mathcal{O}\left(n/p+\log p\right)$ on $p$ processors. The amount of communication between the processors is very small and independent of the sample size. We also discuss modifications needed for load balancing, reservoir sampling, online sampling, sampling with replacement, Bernoulli sampling, and vectorization on SIMD units or GPUs.

PDF Abstract

Categories


Data Structures and Algorithms Distributed, Parallel, and Cluster Computing Mathematical Software G.4; G.3; G.2

Datasets


  Add Datasets introduced or used in this paper