aboutsummaryrefslogtreecommitdiff
path: root/vignettes/prebuilt/2022_dmta_pathway.rmd
diff options
context:
space:
mode:
Diffstat (limited to 'vignettes/prebuilt/2022_dmta_pathway.rmd')
-rw-r--r--vignettes/prebuilt/2022_dmta_pathway.rmd24
1 files changed, 18 insertions, 6 deletions
diff --git a/vignettes/prebuilt/2022_dmta_pathway.rmd b/vignettes/prebuilt/2022_dmta_pathway.rmd
index ff2b527c..1e1a0719 100644
--- a/vignettes/prebuilt/2022_dmta_pathway.rmd
+++ b/vignettes/prebuilt/2022_dmta_pathway.rmd
@@ -1,7 +1,7 @@
---
title: "Testing hierarchical pathway kinetics with residue data on dimethenamid and dimethenamid-P"
author: Johannes Ranke
-date: Last change on 8 January 2023, last compiled on `r format(Sys.time(), "%e %B %Y")`
+date: Last change on 20 April 2023, last compiled on `r format(Sys.time(), "%e %B %Y")`
geometry: margin=2cm
bibliography: references.bib
toc: true
@@ -45,10 +45,17 @@ library(knitr)
library(saemix)
library(parallel)
n_cores <- detectCores()
-if (Sys.info()["sysname"] == "Windows") {
- cl <- makePSOCKcluster(n_cores)
-} else {
- cl <- makeForkCluster(n_cores)
+
+# We need to start a new cluster after defining a compiled model that is
+# saved as a DLL to the user directory, therefore we define a function
+# This is used again after defining the pathway model
+start_cluster <- function(n_cores) {
+ if (Sys.info()["sysname"] == "Windows") {
+ ret <- makePSOCKcluster(n_cores)
+ } else {
+ ret <- makeForkCluster(n_cores)
+ }
+ return(ret)
}
```
@@ -163,6 +170,8 @@ m_hs_path_1 <- mkinmod(
unload = TRUE, overwrite = TRUE,
quiet = TRUE
)
+cl <- start_cluster(n_cores)
+
deg_mods_1 <- list(
sfo_path_1 = m_sfo_path_1,
fomc_path_1 = m_fomc_path_1,
@@ -332,6 +341,10 @@ plot(saem_sforb_path_1_tc_reduced)
Plots of the remaining fits and listings for all successful fits are shown in
the Appendix.
+```{r}
+stopCluster(cl)
+```
+
# Conclusions
@@ -410,7 +423,6 @@ tex_listing(saem_sforb_path_1_tc_reduced, caption)
## Session info
```{r, echo = FALSE}
-parallel::stopCluster(cl)
sessionInfo()
```

Contact - Imprint