Skip to content
Snippets Groups Projects
Commit 61718e08 authored by David Klein's avatar David Klein
Browse files

Bugfix in start scripts (testOneRegi) and compareScenarios

parent 08e58efe
No related branches found
No related tags found
1 merge request!42Bugfix in start scripts (testOneRegi) and compareScenarios
...@@ -52,7 +52,7 @@ start_comp <- function(outputdirs,shortTerm,outfilename) { ...@@ -52,7 +52,7 @@ start_comp <- function(outputdirs,shortTerm,outfilename) {
cat("Starting ",jobname,"\n") cat("Starting ",jobname,"\n")
on_cluster <- file.exists("/p/projects/") on_cluster <- file.exists("/p/projects/")
if (on_cluster) { if (on_cluster) {
system(paste0("srun --qos=standby --job-name=",jobname," --output=",jobname,".out --error=",jobname,".err --mail-type=END --time=200 --mem-per-cpu=8000 Rscript scripts/utils/run_compareScenarios.R outputdirs=",paste(outputdirs,collapse=",")," shortTerm=",shortTerm," outfilename=",jobname," &")) system(paste0("sbatch --qos=standby --job-name=",jobname," --output=",jobname,".out --error=",jobname,".err --mail-type=END --time=200 --mem-per-cpu=8000 Rscript scripts/utils/run_compareScenarios.R outputdirs=",paste(outputdirs,collapse=",")," shortTerm=",shortTerm," outfilename=",jobname))
} else { } else {
outfilename <- jobname outfilename <- jobname
tmp.env <- new.env() tmp.env <- new.env()
......
...@@ -13,6 +13,8 @@ if(!exists("source_include")) { ...@@ -13,6 +13,8 @@ if(!exists("source_include")) {
readArgs("outfilename") readArgs("outfilename")
} }
source("compareScenarios.R")
wrap_to_have_a_clean_exit <- function(outputdirs,shortTerm,outfilename) { wrap_to_have_a_clean_exit <- function(outputdirs,shortTerm,outfilename) {
# Set mif path # Set mif path
scenNames <- getScenNames(outputdirs) scenNames <- getScenNames(outputdirs)
......
...@@ -101,6 +101,8 @@ config.file <- argv[1] ...@@ -101,6 +101,8 @@ config.file <- argv[1]
if ('--testOneRegi' %in% argv) { if ('--testOneRegi' %in% argv) {
testOneRegi <- TRUE testOneRegi <- TRUE
config.file <- NA config.file <- NA
} else {
testOneRegi <- FALSE
} }
if (!is.na(config.file)) { if (!is.na(config.file)) {
...@@ -137,7 +139,7 @@ for (scen in rownames(scenarios)) { ...@@ -137,7 +139,7 @@ for (scen in rownames(scenarios)) {
cfg$results_folder <- 'output/testOneRegi' cfg$results_folder <- 'output/testOneRegi'
# delete existing Results directory # delete existing Results directory
unlink('output/testOneRegi', recursive = TRUE) cfg$force_replace <- TRUE
} }
# configure cfg based on settings from csv if provided # configure cfg based on settings from csv if provided
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment