Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
remind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jerome Hilaire
remind
Commits
f96b4421
Unverified
Commit
f96b4421
authored
4 years ago
by
Lavinia Baumstark
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #136 from dklein-pik/develop
Fix bugs in start scripts
parents
32cb6d3a
611c4e93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
scripts/start/prepare_and_run.R
+12
-0
12 additions, 0 deletions
scripts/start/prepare_and_run.R
start.R
+2
-2
2 additions, 2 deletions
start.R
start_bundle_coupled.R
+3
-1
3 additions, 1 deletion
start_bundle_coupled.R
start_coupled.R
+3
-1
3 additions, 1 deletion
start_coupled.R
with
20 additions
and
4 deletions
scripts/start/prepare_and_run.R
+
12
−
0
View file @
f96b4421
...
@@ -597,6 +597,18 @@ run <- function(start_subsequent_runs = TRUE) {
...
@@ -597,6 +597,18 @@ run <- function(start_subsequent_runs = TRUE) {
# Save start time
# Save start time
timeGAMSStart
<-
Sys.time
()
timeGAMSStart
<-
Sys.time
()
# De-compress finxing files if they have already been zipped (only valid if run is restarted)
if
(
cfg
$
gms
$
cm_startyear
>
2005
)
{
if
(
file.exists
(
"levs.gms.gz"
))
{
cat
(
"Unzip fixing files\n"
)
system
(
"gzip -d -f levs.gms.gz margs.gms.gz fixings.gms.gz"
)
}
else
if
(
file.exists
(
"levs.gms"
))
{
cat
(
"Found unzipped fixing files. Using them.\n"
)
}
else
{
stop
(
"cm_startyear > 2005 but no fixing files found, neither zipped or unzipped."
)
}
}
# Print message
# Print message
cat
(
"\nStarting REMIND...\n"
)
cat
(
"\nStarting REMIND...\n"
)
...
...
This diff is collapsed.
Click to expand it.
start.R
+
2
−
2
View file @
f96b4421
...
@@ -44,10 +44,10 @@ get_line <- function(){
...
@@ -44,10 +44,10 @@ get_line <- function(){
choose_folder
<-
function
(
folder
,
title
=
"Please choose a folder"
)
{
choose_folder
<-
function
(
folder
,
title
=
"Please choose a folder"
)
{
dirs
<-
NULL
dirs
<-
NULL
# Detect all output folders containing fulldata.gdx
# Detect all output folders containing fulldata.gdx
or non_optimal.gdx
# For coupled runs please use the outcommented text block below
# For coupled runs please use the outcommented text block below
dirs
<-
sub
(
"/fulldata.gdx"
,
""
,
sub
(
"./output/"
,
""
,
Sys.glob
(
file.path
(
folder
,
"*"
,
"fulldata.gdx"
))))
dirs
<-
sub
(
"/
(non_optimal|
fulldata
)
.gdx"
,
""
,
sub
(
"./output/"
,
""
,
Sys.glob
(
c
(
file.path
(
folder
,
"*"
,
"non_optimal.gdx"
),
file.path
(
folder
,
"*"
,
"fulldata.gdx"
))))
)
# DK: The following outcommented lines are specially made for listing results of coupled runs
# DK: The following outcommented lines are specially made for listing results of coupled runs
#runs <- findCoupledruns(folder)
#runs <- findCoupledruns(folder)
...
...
This diff is collapsed.
Click to expand it.
start_bundle_coupled.R
+
3
−
1
View file @
f96b4421
...
@@ -299,7 +299,9 @@ for(scen in common){
...
@@ -299,7 +299,9 @@ for(scen in common){
}
}
if
(
start_now
){
if
(
start_now
){
if
(
!
exists
(
"test"
))
system
(
paste0
(
"sbatch --qos=priority --job-name="
,
runname
,
" --output="
,
runname
,
".log --mail-type=END --comment=REMIND-MAgPIE --tasks-per-node="
,
nr_of_regions
,
" --wrap=\"Rscript start_coupled.R coupled_config="
,
runname
,
".RData\""
))
# Start SSP2-Base and SSP2-NDC as priority jobs since ALL subsequent runs depend on them
qos
<-
ifelse
(
grepl
(
"SSP2-(NDC|Base)"
,
runname
),
"priority"
,
"short"
)
if
(
!
exists
(
"test"
))
system
(
paste0
(
"sbatch --qos="
,
qos
,
" --job-name="
,
runname
,
" --output="
,
runname
,
".log --mail-type=END --comment=REMIND-MAgPIE --tasks-per-node="
,
nr_of_regions
,
" --wrap=\"Rscript start_coupled.R coupled_config="
,
runname
,
".RData\""
))
else
cat
(
"Test mode: run NOT submitted to the cluster\n"
)
else
cat
(
"Test mode: run NOT submitted to the cluster\n"
)
}
else
{
}
else
{
cat
(
paste0
(
"Run "
,
runname
,
" will start after preceding run "
,
prefix_runname
,
settings_remind
[
scen
,
"path_gdx_ref"
],
" has finished\n"
))
cat
(
paste0
(
"Run "
,
runname
,
" will start after preceding run "
,
prefix_runname
,
settings_remind
[
scen
,
"path_gdx_ref"
],
" has finished\n"
))
...
...
This diff is collapsed.
Click to expand it.
start_coupled.R
+
3
−
1
View file @
f96b4421
...
@@ -209,7 +209,9 @@ start_coupled <- function(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_it
...
@@ -209,7 +209,9 @@ start_coupled <- function(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_it
#start subsequent runs via sbatch
#start subsequent runs via sbatch
for
(
run
in
cfg_rem
$
subsequentruns
){
for
(
run
in
cfg_rem
$
subsequentruns
){
cat
(
"Submitting subsequent run"
,
run
,
"\n"
)
cat
(
"Submitting subsequent run"
,
run
,
"\n"
)
system
(
paste0
(
"sbatch --qos=priority --job-name=C_"
,
run
,
" --output=C_"
,
run
,
".log --mail-type=END --comment=REMIND-MAgPIE --tasks-per-node="
,
nr_of_regions
,
" --wrap=\"Rscript start_coupled.R coupled_config=C_"
,
run
,
".RData\""
))
# Start SSP2-Base and SSP2-NDC as priority jobs since ALL subsequent runs depend on them
qos
<-
ifelse
(
grepl
(
"SSP2-(NDC|Base)"
,
run
),
"priority"
,
"short"
)
system
(
paste0
(
"sbatch --qos="
,
qos
,
" --job-name=C_"
,
run
,
" --output=C_"
,
run
,
".log --mail-type=END --comment=REMIND-MAgPIE --tasks-per-node="
,
nr_of_regions
,
" --wrap=\"Rscript start_coupled.R coupled_config=C_"
,
run
,
".RData\""
))
}
}
# Read runtime of ALL coupled runs (not just the current scenario) and produce comparison pdf
# Read runtime of ALL coupled runs (not just the current scenario) and produce comparison pdf
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment