Skip to content

Commit

Permalink
Respect cores in mcp(). Closes #160
Browse files Browse the repository at this point in the history
  • Loading branch information
lindeloev committed Mar 14, 2024
1 parent e2999a1 commit cb54b7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/run_jags.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ run_jags = function(data,
} else if (cores == "all" || cores > 1) {
# PARALLEL using the future package and one chain per worker
message("Parallel sampling in progress...")
future::plan(future::multisession, .skip = TRUE)
future::plan(future::multisession, workers = cores, .skip = TRUE)
samples = future.apply::future_lapply(
sample(1:1000, n.chains), # Random seed to JAGS
n.chains = 1,
Expand Down

0 comments on commit cb54b7e

Please sign in to comment.