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

submit_models(
  .mods,
  .bbi_args = NULL,
  .mode = c("sge", "local"),
  ...,
  .config_path = file.path(get_model_directory() %||% ".", "babylon.yaml"),
  .wait = TRUE,
  .dry_run = FALSE,
  .directory = NULL
)

# S3 method for list
submit_models(
  .mods,
  .bbi_args = NULL,
  .mode = c("sge", "local"),
  ...,
  .config_path = file.path(get_model_directory() %||% ".", "babylon.yaml"),
  .wait = TRUE,
  .dry_run = FALSE,
  .directory = NULL
)

# S3 method for character
submit_models(
  .mods,
  .bbi_args = NULL,
  .mode = c("sge", "local"),
  ...,
  .config_path = file.path(get_model_directory() %||% ".", "babylon.yaml"),
  .wait = TRUE,
  .dry_run = FALSE,
  .directory = get_model_directory()
)

# S3 method for numeric
submit_models(
  .mods,
  .bbi_args = NULL,
  .mode = c("sge", "local"),
  ...,
  .config_path = file.path(get_model_directory() %||% ".", "babylon.yaml"),
  .wait = TRUE,
  .dry_run = FALSE,
  .directory = get_model_directory()
)

Arguments

.mods

The model object to submit. Could be a list of bbi_{.model_type}_model object, a character vector of file paths to models, a numeric vector of integers corresponding to a file names of a models.

.bbi_args

A named list specifying arguments to pass to babylon formatted like list("nm_version" = "nm74gf_nmfe", "json" = T, "threads" = 4). Run print_nonmem_args() to see valid arguments.

.mode

Either "sge", the default, to submit model(s) to the grid or "local" for local execution.

...

args passed through to bbi_exec()

.config_path

Optionally specify a path to a babylon.yml config. If not specified, the config in the model directory will be used by default. Path MUST be either an absolute path or relative to the model directory.

.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.

.directory

Model directory which .mod path is relative to. Defaults to options('rbabylon.model_directory'), which can be set globally with set_model_directory(). Only used when passing a file path for .mod instead of a bbi_{.model_type}_model object.

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 babylon.yml.

Methods (by class)

  • list: Takes a list of bbi_nonmem_model objects.

  • character: Takes a character vector of file paths to models that can be loaded with read_model(). Should be a vector of paths to YAML (with or without .yaml extension), or valid model files (control stream, etc.).

  • numeric: Takes a numeric vector of integers corresponding to file names of models that can be loaded with read_model(). This will only work if you are calling from the same directory as the models, or if you have set options('rbabylon.model_directory') to the directory constaining the relevant model.