This function allows you to execute multiple SWAP runs in parallel.

run_swap_parallel(
  project_paths,
  n_cores = NULL,
  working_dir = NULL,
  swap_files = NULL,
  autoset_output = F,
  force = T,
  verbose = F,
  timeout = Inf
)

Arguments

project_paths

character vector path of all projects which should be run in parallel.

n_cores

(optional) the number of CPU cores to use. Defaults to 2 less than available.

working_dir

(optional) the directory in which model runs will be run, processed, and saved. defaults to parent director of the first project_path

swap_files

(optional) character vector with the same length as project_paths. Defines the name of the swap main files to run. defaults to "swap.swp".

autoset_output

(optional) Flag which if set to TRUE, rswap will automatically detect your observed data provided in the observed file and match it to the SWAP output. if this is set to FALSE, then INLIST csv must be set by the user either manually or with set_swp_output() or change_swap_par() for several other rswap function to work

force

(optional) Flag, if an rswap directory already exists, no new one will be generated/reloaded unless force=TRUE defaults to true.

verbose

(optional) Flag, print status?

timeout

(optional) numeric, number of seconds before run timeout (unlimited by default)

Value

Nested list of SWAP status codes for each run (100 = sucess)

Examples


if(FALSE){
project_paths <- list.files("C:/somepath/", full.names = T, pattern = "hupsel")
run_swap_parallel(project_paths)
}