Skip to content
Snippets Groups Projects
Commit 42842eda authored by Hofstra, Nynke's avatar Hofstra, Nynke
Browse files

Merge branch 'mapping-tool' of https://git.wur.nl/glowpa/glowpa-model into mapping-tool

parents 25b271a5 4f6c78a6
Branches master
No related tags found
No related merge requests found
......@@ -58,8 +58,8 @@ glowpa.run <- function(scenario,human_data,isoraster,popurban,poprural,wwtp_inpu
# merge defaults for scenario with scenario
result = withCallingHandlers({
SCENARIO <<- glowpa.get.params(scenario)
log_file <- file.path(SCENARIO$model_output,sprintf("logs/log_run%s_pid%s.txt",SCENARIO$run, Sys.getpid()))
logger.init(log_file)
LOG_FILE <<- file.path(SCENARIO$model_output,sprintf("logs/log_run%s_pid%s.txt",SCENARIO$run, Sys.getpid()))
logger.init(LOG_FILE)
log_info('Start scenario run with id {SCENARIO$run}')
params_table <- logger.get.table(SCENARIO)
log_info('Model started with following params:\n{params_table}')
......
......@@ -23,8 +23,14 @@ pathogenflow.run <- function(pathogen){
tic("calc pathogenflows loadings")
# for debugging inside getLoadings
# loadings <- pathogenflows::getLoadings(onsite_data$urban$child,pathogen_type)
cl <- makeCluster(detectCores())
cl <- makeCluster(detectCores(),outfile=LOG_FILE)
clusterEvalQ(cl, library(pathogenflows))
clusterExport(cl, varlist=c("log_info"))
loadings <- parLapply(cl,unlist(onsite_data,recursive = F),fun = function(x){
session_info <- sessionInfo()
pid <- Sys.getpid()
log_info("pathogenflows pid {pid} : R version: {session_info$R.version$version.string}")
log_info("pathogenflows pid {pid} : Library path: {.libPaths()}")
out <- pathogenflows::getLoadings(x,pathogen_type)
return(out)
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment