Skip to content

Seeding ensemble problems #421

@kaandocal

Description

@kaandocal

I have been going through the code & documentation of JumpProcesses in order to find out how to set up reproducible (RNG seeded) ensemble runs. The following snippet yields the same output each time, as intended:

jprob::JumpProblem
eprob = EnsembleProblem(jprob)
    
solve(eprob, SSAStepper(), EnsembleSerial(); trajectories=10, seed=42)

If I replace EnsembleSerial by EnsembleThreads, the outputs stop being reproducible.

I am aware that JumpProblem seems to have an rng field, so one naive solution would be to use the prob_func argument to EnsembleProblem and remake the jump problem with a different seed for each trajectory. That is not directly possible since remake does not accept a seed or rng argument, so I currently recreate the JumpProblem from scratch (which is less than ideal).

There might be a solution to this online, but I haven't found anything, which seems surprising. Is there any better (intended) way of doing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions