batchtools icon indicating copy to clipboard operation
batchtools copied to clipboard

Trouble with LSF support

Open michaelmayer2 opened this issue 6 years ago • 0 comments

We just released some new changes to LSF 10.1 on our cluster. As a result we now provide some default values for all resources (number of cores, amount of memory, elapsed time). In case users do not specify any of that we have an esub script that spits out some messages when bsub is run saying that default values are going to be used.

This behavior effectively breaks batchtools as it no longer can identify the LSF job IDs. I produced a patch (see below) that fixes the issue. Basically it no longer scans for the first number, it scans for the first number that is wrapped around <> signs.

Happy to discover further.

Michael.

PS: I really love batchtools and i see it being used quite a lot in my local environment.

index 155596a..c810ac1 100644
--- a/R/clusterFunctionsLSF.R
+++ b/R/clusterFunctionsLSF.R
@@ -43,7 +43,8 @@ makeClusterFunctionsLSF = function(template = "lsf", scheduler
     if (res$exit.code > 0L) {
       cfHandleUnknownSubmitError("bsub", res$exit.code, res$output)
     } else {
-      batch.id = stri_extract_first_regex(stri_flatten(res$output, " "), "\\d+"
+      tmpstr = stri_extract_first_regex(stri_flatten(res$output, " "), "<\\d+>"
+      batch.id=stri_sub(tmpstr,2,stri_length(tmpstr)-1)
       makeSubmitJobResult(status = 0L, batch.id = batch.id)
     }
   }

michaelmayer2 avatar Sep 10 '19 11:09 michaelmayer2