Last chance! 50% off unlimited learning
Sale ends in
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)
Name of the drake example
from which to take the template file.
Must be listed in drake_examples()
.
Character vector, where to write the file.
Logical, whether to overwrite an existing file of the same name.
NULL
is returned,
but a batchtools template file is written.
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_mtcars_example() # Get the code with drake_example("mtcars").
# 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 mtcars 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
})
# }
Run the code above in your browser using DataLab