Skip to content

Commit

Permalink
fix future pb locally
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienLeGuillou committed Oct 23, 2024
1 parent 3c12666 commit 7a00c4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/netsim_scenarios.R
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ merge_netsim_scenarios <- function(sim_dir, output_dir,
if (!fs::dir_exists(output_dir)) fs::dir_create(output_dir)
batches_infos <- EpiModelHPC::get_scenarios_batches_infos(sim_dir)

oopts <- options(future.globals.maxSize = Inf)
on.exit(options(oopts))
future.apply::future_lapply(
unique(batches_infos$scenario_name),
function(scenario) {
Expand Down Expand Up @@ -336,8 +338,6 @@ step_tmpl_merge_netsim_scenarios <- function(sim_dir, output_dir,
keep.nwstats, keep.other, param.error, keep.diss.stats,
truncate.at, n_cores) {
future::plan("multicore", workers = n_cores)
oopts <- options(future.globals.maxSize = Inf)
on.exit(options(oopts))
EpiModelHPC::merge_netsim_scenarios(
sim_dir, output_dir,
keep.transmat, keep.network, keep.nwstats, keep.other, keep.diss.stats,
Expand Down Expand Up @@ -380,6 +380,8 @@ merge_netsim_scenarios_tibble <- function(sim_dir, output_dir, steps_to_keep,
.data$scenario_name == scenario
)

oopts <- options(future.globals.maxSize = Inf)
on.exit(options(oopts))
df_list <- future.apply::future_lapply(
seq_len(nrow(scenario_infos)),
function(i) {
Expand Down Expand Up @@ -422,8 +424,6 @@ step_tmpl_merge_netsim_scenarios_tibble <- function(
setup_lines = NULL) {
merge_fun <- function(sim_dir, output_dir, steps_to_keep, cols, n_cores) {
future::plan("multicore", workers = n_cores)
oopts <- options(future.globals.maxSize = Inf)
on.exit(options(oopts))
EpiModelHPC::merge_netsim_scenarios_tibble(
sim_dir = sim_dir,
output_dir = output_dir,
Expand Down

0 comments on commit 7a00c4f

Please sign in to comment.