Learn Python and AI for free! One week only. No credit card needed.
Ends in:
This function produces a conservative
estimate for predict_runtime()
for when parallel computing is used in make()
.
This feature is experimental.
The accuracy, precision, and utility of these supposedly
rate-limiting times has not been confirmed by rigorous
performance studies.
rate_limiting_times(config = drake::read_drake_config(), targets = NULL,
from_scratch = FALSE, targets_only = FALSE, future_jobs = 1,
digits = 3)
option internal runtime parameter list of
make(...)
,
produced by both make()
and
drake_config()
.
Character vector, names of targets. Find the rate-limiting times for building these targets plus dependencies. Defaults to all targets.
logical, whether to factor in just the targets or use times from everything, including the imports.
hypothetical number of jobs assumed for the predicted runtime. assuming this number of jobs.
number of digits for rounding the times.
A data frame of times of the worst-case scenario rate-limiting targets in each parallelizable stage.
The stage
column of the returned data frame
is an index that denotes a parallelizable stage.
Within each stage during make()
,
the targets are divided among the available jobs.
For rate_limiting_times()
,
we assume the targets are divided evenly among the jobs
and one job gets all the slowest targets.
The build times of this hypothetical pessimistic job
are returned for each stage.
By default from_scratch
is FALSE
. That way,
rate_limiting_times()
takes into account that some
targets are already up to date, meaning their elapsed
build times will be instant during the next make()
.
For the results to make sense, the previous build times
of all targets need to be available (automatically cached
by make()
). Otherwise, rate_limiting_times()
will warn you and tell you which targets have missing times.
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_basic_example() # Get the code with drake_example("basic").
config <- make(my_plan) # Run the project, build the targets.
rate_limiting_times(config) # Everything is up to date.
# Assume everything runs from scratch with 1 job.
rate_limiting_times(config, from_scratch = TRUE, digits = 4)
# With 2 jobs, some of the targets are not rate-limiting.
rate_limiting_times(
config,
future_jobs = 2,
from_scratch = TRUE,
digits = 4
)
# Find the rate-limiting times of just building targets
# "small" and "large".
rate_limiting_times(
config,
targets = c("small", "large"),
from_scratch = TRUE,
digits = 4
)
})
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab