R/parallel_ui.R
If there are multiple template files in the example, only the first one (alphabetically) is written.
drake_batchtools_tmpl_file(example = drake::drake_examples(), to = getwd(), overwrite = FALSE)
example | Name of the drake example
from which to take the template file.
Must be listed in |
---|---|
to | Character vector, where to write the file. |
overwrite | Logical, whether to overwrite an existing file of the same name. |
NULL
is returned,
but a batchtools template file is written.
drake_examples()
, drake_example()
,
shell_file()
# NOT RUN { test_with_dir("Quarantine side effects.", { load_basic_example() # Get the code with drake_example("basic"). # List the drake examples. Only some have template files. drake_examples() # Write the batchtools template file from the SLURM example. drake_batchtools_tmpl_file("slurm") # Writes batchtools.slurm.tmpl. # Find batchtools.slurm.tmpl with the rest of the example's files. drake_example("slurm") # Writes a new 'slurm' folder with more files. # Run the basic example with a # SLURM-powered parallel backend. Requires SLURM. library(future.batchtools) # future::plan(batchtools_slurm, template = "batchtools.slurm.tmpl") # nolint # make(my_plan, parallelism = "future_lapply") # nolint }) # }