metrumresearchgroup / bbi

Next generation modeling platform
11 stars 2 forks source link

model_summary doesnt report post processing time in some instances #273

Closed barrettk closed 1 year ago

barrettk commented 1 year ago

The following 'complex' model does not report post processing time:

MODEL_DIR <- system.file("model", "nonmem", "complex",   package = "bbr")

mod <- read_model(file.path(MODEL_DIR, "acop-fake-bayes"))
sum <- mod %>% model_summary()
> sum$run_details
$version
[1] "7.4.4"

$run_start
[1] "-999999999"

$run_end
[1] "Thu Mar  4 13:44:50 EST 2021"

$estimation_time
[1] 2.35 0.11 8.26

$covariance_time
[1] 0.00 8.42

$cpu_time
[1] 19.117

$function_evaluations
[1] 366

$significant_digits
[1] 3.2

$problem_text
[1] "LEM PK model 1 cmt base"

$mod_file
[1] "-999999999"

$estimation_method
[1] "First Order Conditional Estimation with Interaction" "MCMC Bayesian Analysis"                             
[3] "Importance Sampling"                                

$data_set
[1] "../../../../extdata/acop.csv"

$number_of_subjects
[1] 40

$number_of_obs
[1] 760

$number_of_data_records
[1] 799

$output_files_used
[1] "acop-fake-bayes.lst" "acop-fake-bayes.cpu" "acop-fake-bayes.ext" "acop-fake-bayes.shk"
barrettk commented 1 year ago

@kyleam FYI I looked into this and it seems the issue is on the bbi side of things. It could be because the post processing time was reported to be 0 seconds, but Im assuming this is more likely to be related to the location or something:

inst/model/nonmem/complex/acop-fake-bayes/acop-fake-bayes.lst:

 Elapsed postprocess time in seconds:     0.00
 Elapsed finaloutput time in seconds:     0.00
 #CPUT: Total CPU Time in Seconds,       19.117
Stop Time:
Thu Mar  4 13:44:50 EST 2021
kyleam commented 1 year ago

Yes, it's on the bbi side of things and is because the JSON encoding is set up to omitempty:

ip-10-128-38-27:bbr$ git grep -i 'postproc' 'inst/model/*.lst'
inst/model/nonmem/basic/1/1.lst: Elapsed postprocess time in seconds:     0.46
inst/model/nonmem/complex/1001/1001.lst: Elapsed postprocess time in seconds:     0.46
inst/model/nonmem/complex/acop-fake-bayes/acop-fake-bayes.lst: Elapsed postprocess time in seconds:     0.00
inst/model/nonmem/complex/acop-iov/acop-iov.lst: Elapsed postprocess time in seconds:     0.00
inst/model/nonmem/complex/example2_saemimp/example2_saemimp.lst: Elapsed postprocess time in seconds:     0.00
inst/model/nonmem/complex/iovmm/iovmm.lst: Elapsed postprocess time in seconds:     1.04

ip-10-128-38-27:bbr$ git -C ../bbi grep 'postp' 'parsers/nmparser/structs.go'
parsers/nmparser/structs.go:    PostprocessTime     float64   `json:"postprocess_time,omitempty"`
parsers/nmparser/structs.go:            PostprocessTime:     DefaultFloat64,
barrettk commented 1 year ago

@kyleam should this issue be closes now?

kyleam commented 1 year ago

@kyleam should this issue be closes now?

gh-274 is set to auto-close it, but its merge is held up by an unresolved (and very likely unrelated) ci failure.