Skip to content

Commit

Permalink
artifacts flag for RUN, default True. If True the etc folder will be …
Browse files Browse the repository at this point in the history
…created and all the artifacts produced during compilation will be stored there
  • Loading branch information
Siel committed Mar 28, 2024
1 parent 4842795 commit 4823e45
Show file tree
Hide file tree
Showing 3 changed files with 796 additions and 779 deletions.
4 changes: 3 additions & 1 deletion R/NPrun.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
#' in the first cycle, with a speed-up of approximately 80\% of the number of available cores on your machine, e.g. an 8-core machine
#' will speed up the first cycle by 0.8 * 8 = 6.4-fold. Subsequent cycles approach about 50\%, e.g. 4-fold increase on an 8-core
#' machine. Overall speed up for a run will therefore depend on the number of cycles run and the number of cores.
#' @param artifacts Default is \code{TRUE}. Set to \code{FALSE} to suppress creating the \code{etc} folder. This folder
#' will contain all the compilation artifacts created during the compilation and run steps.
#' @param alq For internal developer use only. Should be set to \code{FALSE}.
#' @param remote Default is \code{FALSE}. Set to \code{TRUE} if loading results of an NPAG run on remote server.
#' @param server_address If missing, will use the default server address returned by getPMoptions().
Expand Down Expand Up @@ -98,7 +100,7 @@ NPrun <- function(model = "model.txt", data = "data.csv", run,
indpts, icen = "median", aucint,
idelta = 12, prior,
auto = TRUE, intern = FALSE, quiet = FALSE, overwrite = FALSE, nocheck = FALSE, parallel = NA,
alq = FALSE, remote = FALSE, server_address, report = TRUE) {
alq = FALSE, remote = FALSE, server_address, report = TRUE, artifacts = TRUE) {
if (missing(run)) run <- NULL
if (missing(include)) include <- NULL
if (missing(exclude)) exclude <- NULL
Expand Down
9 changes: 9 additions & 0 deletions R/PM_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ PM_fit <- R6::R6Class("PM_fit",
}
dir.create(newdir)
setwd(newdir)
### Move temp folder to ect/PMcore ###
# check if temp folder exist, create if not
if (arglist$artifacts) {
if (!file.exists("etc")) {
dir.create("etc")
}
system(sprintf("cp -R %s etc/PMcore", getPMoptions()$rust_template))
}
# Include or exclude subjects according to
data_filtered <- self$data$standard_data
if (!is.symbol(arglist$include)) {
Expand Down Expand Up @@ -288,6 +296,7 @@ PM_fit <- R6::R6Class("PM_fit",
}
} else {
system2("./NPcore", args = "&")
# TODO: The code to generate the report is missing here
}
setwd(cwd)
},
Expand Down
Loading

0 comments on commit 4823e45

Please sign in to comment.