aboutsummaryrefslogtreecommitdiff
path: root/R/saem.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2023-04-15 15:35:06 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2023-04-15 15:35:06 +0200
commitb0b710ee9f9bb9bbe9708676d0c5822465e02203 (patch)
tree537dcf86326ab2e03100a5defb11b264a4b72a17 /R/saem.R
parent50ea6d11f8c79218c98ee8ae56d8bdcd42cc703a (diff)
Make predefined symbols safer
We still need to create a parallel processing cluster _after_ creating a compiled model that is moved to a user defined location, at least I did not find another way to make it work. This is not a problem with parallel processing without a cluster, which is not available on Windows.
Diffstat (limited to 'R/saem.R')
-rw-r--r--R/saem.R8
1 files changed, 6 insertions, 2 deletions
diff --git a/R/saem.R b/R/saem.R
index 2fa770bb..83de97b0 100644
--- a/R/saem.R
+++ b/R/saem.R
@@ -583,11 +583,15 @@ saemix_model <- function(object, solution_type = "auto",
transform_fractions <- object[[1]]$transform_fractions
# Get native symbol info for speed
+ use_symbols = FALSE
if (solution_type == "deSolve" & !is.null(mkin_model$cf)) {
- mkin_model$symbols <- deSolve::checkDLL(
+ mkin_model$symbols <- try(deSolve::checkDLL(
dllname = mkin_model$dll_info[["name"]],
func = "diffs", initfunc = "initpar",
- jacfunc = NULL, nout = 0, outnames = NULL)
+ jacfunc = NULL, nout = 0, outnames = NULL))
+ if (!inherits(mkin_model$symbols, "try-error")) {
+ use_symbols = TRUE
+ }
}
# Define the model function

Contact - Imprint