job_stats: Get job stats for a completed NONMEM run

View source: R/job_stats.R

job_statsR Documentation

Get job stats for a completed NONMEM run

Description

[Experimental]

Gets attributes of the run like run time, queue time.

Usage

job_stats(m)

Arguments

m

An nm object.

Value

A wide format tibble with information about the job execution times.

Examples


## Below code requires NONMEM to be installed
## Not run: 

#' # create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))

dc <- tibble(cores = c(1, 3, 10, 30)) %>%
  mutate(m = m1 %>%
    child(run_id = cores) %>%
    run_in("Models/m1_coretest") %>%
    cmd("execute {ctl_name} -parafile={parafile} -dir={run_dir} -nodes={cores}") %>%
    parafile("/opt/NONMEM/nm75/run/mpilinux8.pnm") %>%
    cores(cores))

dc$m %>% cmd()

dc$m %>%
  run_nm() %>%
  wait_finish()

## extract job statistics and plot cores vs Rtime or Ttime
## to get plots of run time and total time vs number of CPUs

dc$m %>%
  job_stats() %>%
  ggplot(aes(x = cores, y = Rtime)) +
  theme_bw() +
  geom_point()

## End(Not run)


NMproject documentation built on Sept. 30, 2022, 1:06 a.m.