test_threads | R Documentation |
Takes a model object and runs it with various threads values
test_threads(
.mod,
.threads = c(2, 4),
.bbi_args = list(),
.cap_iterations = 10,
...
)
.mod |
bbi_model object to copy/test. |
.threads |
Integer vector of threads values to test. |
.bbi_args |
a named list. |
.cap_iterations |
Maximum number of iterations for NONMEM to run in test models.
Will update |
... |
args passed through to submit_models() |
Unfortunately, there is no easy way to know how many threads are ideal for a given NONMEM model. It is dependent on many factors, including model complexity and the structure of the input data. Typically, the best way to find the ideal number of threads for a given model is to test it empirically. This function is intended to help the user do this.
The function will create copies of your model, cap the number of evaluation iterations, and then
run these copies with the specified number of threads. The check_run_times()
helper can then
be used to easily see how long each test model ran for, giving you a good sense of what the ideal
number of threads might be.
A list of the model objects for the submitted models.
## Not run:
mod <- read_model(file.path(MODEL_DIR, 1))
mods <- test_threads(.mod = mod, .threads = c(2, 4), .cap_iterations = 10,
.mode = "local")
check_run_times(mods, .wait = TRUE, .time_limit = 100)
check_run_times(mods, .wait = FALSE, .return_times = "all")
delete_models(.mods = mods)
# Dry Run:
mods <- test_threads(.mod = mod, .threads = c(2, 4), .cap_iterations = 10,
.mode = "local", .dry_run = TRUE)
delete_models(.mods = mods)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.