Skip to content
Open
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
13 changes: 7 additions & 6 deletions base/workflow/R/start_model_runs.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,7 @@ start_model_runs <- function(settings, write = TRUE, stop.on.error = TRUE) {
}

# Write finish time to database
#TODO this repeats for every run in `jobids` writing every run's time stamp every time. This actually takes quite a long time with a lot of ensembles and should either 1) not be a for loop (no `for(x in run_list)`) or 2) if `is_modellauncher`, be done outside of the jobids for loop after all jobs are finished.
if (is_modellauncher && write) {
for (x in run_list) {
PEcAn.DB::stamp_finished(con = dbcon, run = x)
}
} else {
if (!is_modellauncher) {
if (write) {
PEcAn.DB::stamp_finished(con = dbcon, run = run)
}
Expand All @@ -350,6 +345,12 @@ start_model_runs <- function(settings, write = TRUE, stop.on.error = TRUE) {
} # end loop over runs
} # end while loop checking runs

if (is_modellauncher && write) {
for (x in run_list) {
PEcAn.DB::stamp_finished(con = dbcon, run = x)
}
}

# Copy data back to local
if (!is_local) {
PEcAn.utils::retry.func(
Expand Down