Skip to contents

Run a simulation

The general parallel simulation algorithm, with the worker as an argument.

sim_template()
Run a simulation experiment in parallel
sim_template_serial()
Run a simulation experiment in a single process
bind_results()
Combine per-process results

Building blocks

The pieces of the template, for writing your own driver or worker.

make_set_up()
Build the per-process set-up lists
split_reps()
Divide replications evenly across worker processes
set_worker_rng()
Seed the PCG64 generator inside a worker

The book’s workers

The example workers from Chapters 3 and 5.

pi_worker()
Worker: estimate pi by dart throwing
iqr_worker()
Worker: Cauchy scale via the interquartile range
regression_worker()
Worker: segmented regression bootstrap

Timing

benchmark_cores()
Time a simulation across core counts

Package

simstreams simstreams-package
simstreams: Parallel Simulation Experiments on a Personal Computer