Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PopED win parallel #141

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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()

Check warning on line 3136 in R/poped.R

View check run for this annotation

Codecov / codecov/patch

R/poped.R#L3134-L3136

Added lines #L3134 - L3136 were not covered by tests
}
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.

Loading