Run a pipeline of targets in parallel with persistent clustermq workers.
This function is like tar_make()
except that targets
run in parallel with persistent clustermq
workers. It requires
that you set global options like clustermq.scheduler
and
clustermq.template
inside the target script file
(default: _targets.R
).
clustermq
is not a strict dependency of targets
,
so you must install clustermq
yourself.
tar_make_clustermq( names = NULL, shortcut = targets::tar_config_get("shortcut"), reporter = targets::tar_config_get("reporter_make"), workers = targets::tar_config_get("workers"), log_worker = FALSE, callr_function = callr::r, callr_arguments = targets::callr_args_default(callr_function, reporter), envir = parent.frame(), script = targets::tar_config_get("script"), store = targets::tar_config_get("store") )
names |
Names of the targets to build or check. Set to |
shortcut |
Logical of length 1, how to interpret the |
reporter |
Character of length 1, name of the reporter to user.
Controls how messages are printed as targets run in the pipeline.
Defaults to
|
workers |
Positive integer, number of persistent |
log_worker |
Logical, whether to write a log file for each worker.
Same as the |
callr_function |
A function from |
callr_arguments |
A list of arguments to |
envir |
An environment, where to run the target R script
(default: The |
script |
Character of length 1, path to the
target script file. Defaults to |
store |
Character of length 1, path to the
|
To use with a cluster, you will need to set the global options
clustermq.scheduler
and clustermq.template
inside the
target script file (default: _targets.R
).
To read more about configuring clustermq
for your scheduler, visit
https://mschubert.github.io/clustermq/articles/userguide.html#configuration # nolint
and navigate to the appropriate link under "Setting up the scheduler".
Wildcards in the template file are filled in with elements from
tar_option_get("resources")
.
NULL
except if callr_function = callr::r_bg()
, in which case
a handle to the callr
background process is returned. Either way,
the value is invisibly returned.
Other pipeline:
tar_make_future()
,
tar_make()
if (!identical(tolower(Sys.info()[["sysname"]]), "windows")) { if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ options(clustermq.scheduler = "multicore") # Does not work on Windows. tar_option_set() list(tar_target(x, 1 + 1)) }, ask = FALSE) tar_make_clustermq() }) } }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.