Skip to content

doRNG one registerDoRNG(3.14) backend used to generate different sequences of streams of seeds #11

@bashirhamidi

Description

@bashirhamidi

Dear Renaud,
I’m using your package in a foreach dopar loop to run a simulation. I’d like to manually split up the simulation to five (5) different machines to reduce computation time.

Entire simulation has 500k loops, but separated to different machine each will have 100k loops. I’d like to have a unique attr(df, "rng") for each of 500k loops using one registerDoRNG seed. For instance, for me to specify

  • machine1 to use registerDoRNG(3.14), generate rngs from 1:100k
  • machine2 to use registerDoRNG(3.14), generate rngs from 100,001:200k
  • repeat for all other machines.

Is there any way I could specify this using doRNG?

Currently I have

registerDoRNG(3.14)
res <- foreach::foreach(i=1:500000,
                               .combine=rbind,
                               .packages = c("permute", "lattice", "matrixStats", "vegan", "HMP")
                               ) %dopar%
  {
    df <- simulation code here
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions