dust_rng_distributed: Create a set of distributed seeds

dust_rng_distributed_stateR Documentation

Create a set of distributed seeds

Description

Create a set of initial random number seeds suitable for using within a distributed context (over multiple processes or nodes) at a level higher than a single group of synchronised threads.

Usage

dust_rng_distributed_state(
  seed = NULL,
  n_streams = 1L,
  n_nodes = 1L,
  algorithm = "xoshiro256plus"
)

dust_rng_distributed_pointer(
  seed = NULL,
  n_streams = 1L,
  n_nodes = 1L,
  algorithm = "xoshiro256plus"
)

Arguments

seed

Initial seed to use. As for dust_rng, this can be NULL (create a seed using R's generators), an integer or a raw vector of appropriate length.

n_streams

The number of streams to create per node. If passing the results of this seed to a dust object's initialiser (see dust_generator) you can safely leave this at 1, but if using in a standalone setting, and especially if using dust_rng_distributed_pointer, you may need to set this to the appropriate length.

n_nodes

The number of separate seeds to create. Each will be separated by a "long jump" for your generator.

algorithm

The name of an algorithm to use. Alternatively pass a dust_generator or dust object here to select the algorithm used by that object automatically.

Details

See vignette("rng_distributed") for a proper introduction to these functions.

Value

A list of either raw vectors (for dust_rng_distributed_state) or of dust_rng_pointer objects (for dust_rng_distributed_pointer)

Examples

dust::dust_rng_distributed_state(n_nodes = 2)
dust::dust_rng_distributed_pointer(n_nodes = 2)

mrc-ide/dust documentation built on May 21, 2022, 7:57 a.m.