submit_models: Submit models to be run in batch

View source: R/submit-models.R

submit_modelsR Documentation

Submit models to be run in batch

Description

Submits a group of models to be run in batch by calling out to bbi in as few external calls as possible (see "Details").

Usage

submit_models(
  .mods,
  .bbi_args = NULL,
  .mode = getOption("bbr.bbi_exe_mode"),
  ...,
  .overwrite = NULL,
  .config_path = NULL,
  .wait = TRUE,
  .dry_run = FALSE
)

## S3 method for class 'list'
submit_models(
  .mods,
  .bbi_args = NULL,
  .mode = getOption("bbr.bbi_exe_mode"),
  ...,
  .overwrite = NULL,
  .config_path = NULL,
  .wait = TRUE,
  .dry_run = FALSE
)

Arguments

.mods

The model objects to submit.

.bbi_args

A named list specifying arguments to pass to bbi formatted like list("nm_version" = "nm74gf_nmfe", "json" = T, "threads" = 4). Run print_bbi_args() to see valid arguments. Note that bbr does not support changing the output directory (including through the model or global YAML files).

.mode

Either "sge", the default, to submit model(s) to the grid or "local" for local execution. This can be passed directly to this argument or set globally with options("bbr.bbi_exe_mode").

...

args passed through to bbi_exec()

.overwrite

Logical to specify whether or not to overwrite existing model output from a previous run. If NULL, the default, will defer to setting in .bbi_args or bbi.yaml. If not NULL will override any settings in .bbi_args or bbi.yaml.

.config_path

Path to a bbi configuration file. If NULL, the default, will attempt to use a bbi.yaml in the same directory as the model.

.wait

If TRUE, the default, wait for the bbi process to return before this function call returns. If FALSE function will return while bbi process runs in the background.

.dry_run

Returns an object detailing the command that would be run, insted of running it. This is primarily for testing but also a debugging tool.

Details

The number of bbi calls to make is determined by the number of distinct sets of bbi arguments passed to the submission calls, either explicitly through .bbi_args, as specified in the bbi_args field of the model YAML, or specified globally in bbi.yaml.

Methods (by class)

  • submit_models(list): Takes a list of bbi_base_model objects.

Notes on NONMEM model extensions

Before executing the model, bbi first copies the control stream file to a subdirectory. Whether a relative path to the data file in the control stream is adjusted for this change in directory depends on the control stream's file extension:

  • For a model with a .mod extension, bbi automatically adjusts a relative data path to make it relative to the execution directory, following the behavior of PsN.

  • For a model with a .ctl extension, bbi does not adjust the data path. A relative data path in the control stream must be specified one level deeper (i.e. with an additional ⁠../⁠) to account for the model being executed in a subdirectory.

See Also

submit_model()

Other NONMEM model extensions: get_data_path(), submit_model()


metrumresearchgroup/rbabylon documentation built on March 15, 2024, 9:53 p.m.