Skip to content

Commit

Permalink
Use future.seed=TRUE for better RNG in parallel
Browse files Browse the repository at this point in the history
Resolves #384
  • Loading branch information
mitchelloharawild committed Mar 2, 2024
1 parent 2717ced commit d8fbe73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ Check that specified model(s) are model definitions.", nm[which(!is_mdl)[1]]))
rep(models, each = length(lst_data)),
FUN = estimate_progress,
SIMPLIFY = FALSE,
future.globals = FALSE
future.globals = FALSE,
future.seed = TRUE
)
unname(split(out, rep(seq_len(num_mdl), each = num_key)))
}
Expand Down
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ mapply_maybe_parallel <- function (.f, ..., MoreArgs = list(), SIMPLIFY = FALSE)
...,
MoreArgs = MoreArgs,
SIMPLIFY = SIMPLIFY,
future.globals = FALSE
future.globals = FALSE,
future.seed = TRUE
)
}
else{
Expand Down

0 comments on commit d8fbe73

Please sign in to comment.