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] 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")