From 24bd159ed2776ed9eacfea4198e3cedefcb56e4b Mon Sep 17 00:00:00 2001 From: Meet Agrawal Date: Sun, 10 Mar 2024 12:13:49 +0530 Subject: [PATCH 1/5] added checks for cpruncmd and cpoutcmd --- models/sipnet/R/write.configs.SIPNET.R | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/models/sipnet/R/write.configs.SIPNET.R b/models/sipnet/R/write.configs.SIPNET.R index 3fd4684dfcc..396c9681436 100755 --- a/models/sipnet/R/write.configs.SIPNET.R +++ b/models/sipnet/R/write.configs.SIPNET.R @@ -102,8 +102,12 @@ write.config.SIPNET <- function(defaults, trait.values, settings, run.id, inputs jobsh <- gsub("@BINARY@", settings$model$binary, jobsh) jobsh <- gsub("@REVISION@", settings$model$revision, jobsh) - jobsh <- gsub("@CPRUNCMD@", cpruncmd, jobsh) - jobsh <- gsub("@CPOUTCMD@", cpoutcmd, jobsh) + if(!is.identical(cpruncmd, character(0)) { + jobsh <- gsub("@CPRUNCMD@", cpruncmd, jobsh) + } + if(!is.identical(cpoutcmd, character(0)) { + jobsh <- gsub("@CPOUTCMD@", cpoutcmd, jobsh) + } jobsh <- gsub("@RMOUTDIRCMD@", rmoutdircmd, jobsh) jobsh <- gsub("@RMRUNDIRCMD@", rmrundircmd, jobsh) @@ -630,4 +634,4 @@ remove.config.SIPNET <- function(main.outdir, settings) { } else { print("*** WARNING: Removal of files on remote host not yet implemented ***") } -} # remove.config.SIPNET \ No newline at end of file +} # remove.config.SIPNET From dfbb52df894eab92a9072de369bed3d4b8fc5e08 Mon Sep 17 00:00:00 2001 From: Meet Agrawal Date: Sun, 10 Mar 2024 19:35:49 +0530 Subject: [PATCH 2/5] fixed typo --- models/sipnet/R/write.configs.SIPNET.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/sipnet/R/write.configs.SIPNET.R b/models/sipnet/R/write.configs.SIPNET.R index 396c9681436..8d892780873 100755 --- a/models/sipnet/R/write.configs.SIPNET.R +++ b/models/sipnet/R/write.configs.SIPNET.R @@ -102,10 +102,10 @@ write.config.SIPNET <- function(defaults, trait.values, settings, run.id, inputs jobsh <- gsub("@BINARY@", settings$model$binary, jobsh) jobsh <- gsub("@REVISION@", settings$model$revision, jobsh) - if(!is.identical(cpruncmd, character(0)) { + if(!is.identical(cpruncmd, character(0))) { jobsh <- gsub("@CPRUNCMD@", cpruncmd, jobsh) } - if(!is.identical(cpoutcmd, character(0)) { + if(!is.identical(cpoutcmd, character(0))) { jobsh <- gsub("@CPOUTCMD@", cpoutcmd, jobsh) } jobsh <- gsub("@RMOUTDIRCMD@", rmoutdircmd, jobsh) From db0c32a0849fcb10bb4e7ddac4378e463d0c9c40 Mon Sep 17 00:00:00 2001 From: Meet Agrawal Date: Sun, 10 Mar 2024 19:56:28 +0530 Subject: [PATCH 3/5] bug fix --- models/sipnet/R/write.configs.SIPNET.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/sipnet/R/write.configs.SIPNET.R b/models/sipnet/R/write.configs.SIPNET.R index 8d892780873..946f14f665b 100755 --- a/models/sipnet/R/write.configs.SIPNET.R +++ b/models/sipnet/R/write.configs.SIPNET.R @@ -102,10 +102,10 @@ write.config.SIPNET <- function(defaults, trait.values, settings, run.id, inputs jobsh <- gsub("@BINARY@", settings$model$binary, jobsh) jobsh <- gsub("@REVISION@", settings$model$revision, jobsh) - if(!is.identical(cpruncmd, character(0))) { + if(!identical(cpruncmd, character(0))) { jobsh <- gsub("@CPRUNCMD@", cpruncmd, jobsh) } - if(!is.identical(cpoutcmd, character(0))) { + if(!identical(cpoutcmd, character(0))) { jobsh <- gsub("@CPOUTCMD@", cpoutcmd, jobsh) } jobsh <- gsub("@RMOUTDIRCMD@", rmoutdircmd, jobsh) From 2aab647153b8af1dc3ba5bbeafecb4a279189aba Mon Sep 17 00:00:00 2001 From: meetagrawal09 Date: Fri, 17 May 2024 18:38:00 +0530 Subject: [PATCH 4/5] bug fix --- models/sipnet/R/write.configs.SIPNET.R | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/models/sipnet/R/write.configs.SIPNET.R b/models/sipnet/R/write.configs.SIPNET.R index 946f14f665b..b1c0412bd76 100755 --- a/models/sipnet/R/write.configs.SIPNET.R +++ b/models/sipnet/R/write.configs.SIPNET.R @@ -73,6 +73,7 @@ write.config.SIPNET <- function(defaults, trait.values, settings, run.id, inputs cpruncmd <- cpoutcmd <- rmoutdircmd <- rmrundircmd <- "" if (!is.null(settings$host$rabbitmq)) { #rsync cmd from remote to local host. + settings$host$rabbitmq$cpfcmd <- if(settings$host$rabbitmq$cpfcmd == NULL) "" else settings$host$rabbitmq$cpfcmd cpruncmd <- gsub("@OUTDIR@", settings$host$rundir, settings$host$rabbitmq$cpfcmd) cpruncmd <- gsub("@OUTFOLDER@", rundir, cpruncmd) @@ -102,12 +103,8 @@ write.config.SIPNET <- function(defaults, trait.values, settings, run.id, inputs jobsh <- gsub("@BINARY@", settings$model$binary, jobsh) jobsh <- gsub("@REVISION@", settings$model$revision, jobsh) - if(!identical(cpruncmd, character(0))) { - jobsh <- gsub("@CPRUNCMD@", cpruncmd, jobsh) - } - if(!identical(cpoutcmd, character(0))) { - jobsh <- gsub("@CPOUTCMD@", cpoutcmd, jobsh) - } + jobsh <- gsub("@CPRUNCMD@", cpruncmd, jobsh) + jobsh <- gsub("@CPOUTCMD@", cpoutcmd, jobsh) jobsh <- gsub("@RMOUTDIRCMD@", rmoutdircmd, jobsh) jobsh <- gsub("@RMRUNDIRCMD@", rmrundircmd, jobsh) @@ -634,4 +631,4 @@ remove.config.SIPNET <- function(main.outdir, settings) { } else { print("*** WARNING: Removal of files on remote host not yet implemented ***") } -} # remove.config.SIPNET +} # remove.config.SIPNET \ No newline at end of file From 33b4b5addb84f485f71490c2f17ebcd803ad9a78 Mon Sep 17 00:00:00 2001 From: Meet Agrawal Date: Fri, 17 May 2024 19:53:08 +0530 Subject: [PATCH 5/5] updated condition --- models/sipnet/R/write.configs.SIPNET.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/sipnet/R/write.configs.SIPNET.R b/models/sipnet/R/write.configs.SIPNET.R index b1c0412bd76..dc4c48be38d 100755 --- a/models/sipnet/R/write.configs.SIPNET.R +++ b/models/sipnet/R/write.configs.SIPNET.R @@ -73,7 +73,7 @@ write.config.SIPNET <- function(defaults, trait.values, settings, run.id, inputs cpruncmd <- cpoutcmd <- rmoutdircmd <- rmrundircmd <- "" if (!is.null(settings$host$rabbitmq)) { #rsync cmd from remote to local host. - settings$host$rabbitmq$cpfcmd <- if(settings$host$rabbitmq$cpfcmd == NULL) "" else settings$host$rabbitmq$cpfcmd + settings$host$rabbitmq$cpfcmd <- ifelse(is.null(settings$host$rabbitmq$cpfcmd), "", settings$host$rabbitmq$cpfcmd) cpruncmd <- gsub("@OUTDIR@", settings$host$rundir, settings$host$rabbitmq$cpfcmd) cpruncmd <- gsub("@OUTFOLDER@", rundir, cpruncmd) @@ -631,4 +631,4 @@ remove.config.SIPNET <- function(main.outdir, settings) { } else { print("*** WARNING: Removal of files on remote host not yet implemented ***") } -} # remove.config.SIPNET \ No newline at end of file +} # remove.config.SIPNET