From 739c02480a0d2f2229e8e4e8fe68330a08162104 Mon Sep 17 00:00:00 2001 From: Dongchen Zhang Date: Sat, 9 Dec 2023 12:11:23 -0500 Subject: [PATCH] revert back. --- base/workflow/R/start_model_runs.R | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/base/workflow/R/start_model_runs.R b/base/workflow/R/start_model_runs.R index 1e324db58ee..37771d9bf2b 100644 --- a/base/workflow/R/start_model_runs.R +++ b/base/workflow/R/start_model_runs.R @@ -119,14 +119,7 @@ start_model_runs <- function(settings, write = TRUE, stop.on.error = TRUE) { out <- PEcAn.remote::start_rabbitmq( folder, settings$host$rabbitmq$uri, settings$host$rabbitmq$queue) PEcAn.logger::logger.debug("JOB.SH submit status:", out) - - #if we want to detect the job completion by nc files. - if (!is.null(settings$host$rabbitmq$prefix)) { - jobids[run] <- out - } else { - #if we want to detect the job completion by rabbitmq.out files. - jobids[run] <- folder - } + jobids[run] <- folder } else if (is_modellauncher) { # set up launcher script if we use modellauncher @@ -298,13 +291,8 @@ start_model_runs <- function(settings, write = TRUE, stop.on.error = TRUE) { # check to see if job is done job_finished <- FALSE if (is_rabbitmq) { - if (!is.null(settings$host$rabbitmq$prefix)) { - job_finished <- - file.exists(file.path(jobids[run], settings$host$rabbitmq$prefix)) - } else { - job_finished <- - file.exists(file.path(jobids[run], "rabbitmq.out")) - } + job_finished <- + file.exists(file.path(jobids[run], "rabbitmq.out")) } else if (is_qsub) { job_finished <- PEcAn.remote::qsub_run_finished( run = jobids[run], @@ -313,7 +301,7 @@ start_model_runs <- function(settings, write = TRUE, stop.on.error = TRUE) { } if (job_finished) { - + # TODO check output log if (is_rabbitmq) { data <- readLines(file.path(jobids[run], "rabbitmq.out")) @@ -384,4 +372,4 @@ runModule_start_model_runs <- function(settings, stop.on.error=TRUE) { PEcAn.logger::logger.severe( "runModule_start_model_runs only works with Settings or MultiSettings") } -} # runModule_start_model_runs +} # runModule_start_model_runs \ No newline at end of file