From c6cb84cc5835371a3a7eb0b6ab936e4b38ab8f3b Mon Sep 17 00:00:00 2001 From: "Bradley W. Compton" <85038186+bwcompton@users.noreply.github.com> Date: Thu, 12 Jun 2025 21:37:33 -0400 Subject: [PATCH 1/3] Make batch.id robust to warning messages from sbatch --- R/clusterFunctionsSlurm.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/clusterFunctionsSlurm.R b/R/clusterFunctionsSlurm.R index 56385dc8..d8604ab3 100644 --- a/R/clusterFunctionsSlurm.R +++ b/R/clusterFunctionsSlurm.R @@ -66,7 +66,8 @@ makeClusterFunctionsSlurm = function(template = "slurm", array.jobs = TRUE, node return(cfHandleUnknownSubmitError("sbatch", res$exit.code, res$output)) } - id = stri_split_fixed(output[1L], " ")[[1L]][4L] + submitted = grep("^Submitted batch job", stri_split_fixed(output, '\n')[[1L]], value = TRUE) + id = stri_split_fixed(submitted, " ")[[1L]][4L] if (jc$array.jobs) { if (!array.jobs) stop("Array jobs not supported by cluster function") From ce1a227395d38d76c01f71bcaa0e0d52b4662213 Mon Sep 17 00:00:00 2001 From: "Bradley W. Compton" <85038186+bwcompton@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:27:35 -0400 Subject: [PATCH 2/3] test code --- R/clusterFunctionsSlurm.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/clusterFunctionsSlurm.R b/R/clusterFunctionsSlurm.R index d8604ab3..5ec37c0f 100644 --- a/R/clusterFunctionsSlurm.R +++ b/R/clusterFunctionsSlurm.R @@ -67,6 +67,9 @@ makeClusterFunctionsSlurm = function(template = "slurm", array.jobs = TRUE, node } submitted = grep("^Submitted batch job", stri_split_fixed(output, '\n')[[1L]], value = TRUE) + + print(submitted) + id = stri_split_fixed(submitted, " ")[[1L]][4L] if (jc$array.jobs) { if (!array.jobs) From aa666c30301d6a1578723eac0ff530b264b32675 Mon Sep 17 00:00:00 2001 From: "Bradley W. Compton" <85038186+bwcompton@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:57:42 -0400 Subject: [PATCH 3/3] undo test code --- R/clusterFunctionsSlurm.R | 3 --- 1 file changed, 3 deletions(-) diff --git a/R/clusterFunctionsSlurm.R b/R/clusterFunctionsSlurm.R index 5ec37c0f..d8604ab3 100644 --- a/R/clusterFunctionsSlurm.R +++ b/R/clusterFunctionsSlurm.R @@ -67,9 +67,6 @@ makeClusterFunctionsSlurm = function(template = "slurm", array.jobs = TRUE, node } submitted = grep("^Submitted batch job", stri_split_fixed(output, '\n')[[1L]], value = TRUE) - - print(submitted) - id = stri_split_fixed(submitted, " ")[[1L]][4L] if (jc$array.jobs) { if (!array.jobs)