Skip to content

Commit

Permalink
Merge pull request #141 from nlmixr2/poped-win-parallel
Browse files Browse the repository at this point in the history
Add PopED win parallel
  • Loading branch information
mattfidler authored Oct 24, 2024
2 parents 0aa83c5 + e5b327a commit 13a25ec
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ inst/doc
/vignettes/pk.turnover.emax3-nonmem/pk.turnover.emax3-rounding.qs
/vignettes/articles/pk.turnover.emax3-nonmem/pk.turnover.emax3-rounding.qs
/vignettes/articles/pk.turnover.emax4-nonmem/pk.turnover.emax4.qs
/src/Makevars.win
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ S3method(rxUiGet,popedScriptBeforeCtl)
S3method(rxUiGet,popedSettings)
S3method(rxUiGet,popedSigma)
export(.minfo)
export(.popedCluster)
export(.popedF)
export(.popedFree)
export(.popedRxRunSetup)
Expand Down
23 changes: 13 additions & 10 deletions R/poped.R
Original file line number Diff line number Diff line change
Expand Up @@ -344,21 +344,11 @@ rxUiGet.popedFfFun <- function(x, ...) {
poped.db$babelmixr2$optTime)
.ret <- try(.popedSolveIdME(.p, .u, .xt, model_switch, .(length(.predDf$cond)),
.id-1, .totn), silent=TRUE)
if (inherits(.ret, "try-error")) {
rxode2::rxLoad(poped.db$babelmixr2$modelMT)
.ret <- .popedSolveIdME(.p, .u, .xt, model_switch, .(length(.predDf$cond)),
.id-1, .totn)
}
} else if (.lu > .(.poped$maxn)) {
.p <- p[-1]
poped.db <- .popedRxRunFullSetupMe(poped.db, .xt, model_switch)
.ret <- try(.popedSolveIdME2(.p, .u, .xt, model_switch, .(length(.predDf$cond)),
.id-1, .totn), silent=TRUE)
if (inherits(.ret, "try-error")) {
rxode2::rxLoad(poped.db$babelmixr2$modelF)
.ret <- .popedSolveIdME2(.p, .u, .xt, model_switch, .(length(.predDf$cond)),
.id-1, .totn)
}
}
return(list(f=matrix(.ret$rx_pred_, ncol=1),
poped.db=poped.db))
Expand Down Expand Up @@ -3132,3 +3122,16 @@ babelBpopIdx <- function(popedInput, var) {
stop("cannot find '", var, "' in the baelmixr2 poped model",
call.=FALSE)
}

#' Internal function to use with PopED to run PopED in parallel on Windows
#'
#' @param babelmixr2 environment in poped environment
#' @return nothing, called for side effects
#' @export
#' @author Matthew L. Fidler
#' @keywords internal
.popedCluster <- function(babelmixr2) {
rxode2::rxLoad(babelmixr2$modelF)
rxode2::rxLoad(babelmixr2$modelMT)
invisible()
}
21 changes: 21 additions & 0 deletions man/dot-popedCluster.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13a25ec

Please sign in to comment.