Build the future Plan to Run the Simulations of a Batch
Source: R/net.fn.scenarios_run.R
dot-batch_plan.RdExported for the EpiModelHPC slurmworkflow step templates, which run the
same code on a SLURM cluster; it is not meant to be called directly.
Arguments
- control
A
control.netlist. Itsfuture.use.planelement is used as the plan when it holds one set withfuture::tweak().- strategy
A
futurebackend function, e.g.future::multicore.- n_cores
The number of workers to use when
control$future.use.planholds no plan.
Value
A future plan: control$future.use.plan when it is a
future::tweak() plan, else future::tweak(strategy, workers = n_cores).
Details
Only builds the plan: with(future::plan(<plan>), local = TRUE) must be
called by the function running the simulations, as it resets the plan when
its caller exits.
strategy is a function rather than a name, as future::tweak() looks a
name up from the calling frame (this namespace, then the search path) before
the future namespace.