Skip to content

Commit 621ca01

Browse files
makeClusterFunctionsBash(): more debug output
1 parent e7a94a9 commit 621ca01

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.batchtools
2-
Version: 0.20.0-9018
2+
Version: 0.20.0-9019
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

R/batchtools_bash.R

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,28 @@ makeClusterFunctionsBash <- function(template = "bash", fs.latency = 0.0, ...) {
112112
stop_if_not(inherits(reg, "Registry"))
113113
stop_if_not(inherits(jc, "JobCollection"))
114114

115-
script <- cfBrewTemplate(reg, text = template_text, jc = jc)
116-
output <- system2(bin, args = c(script), stdout = TRUE, stderr = TRUE, wait = TRUE)
117115
debug <- isTRUE(getOption("future.debug"))
118116
if (debug) {
119-
mdebug_push("makeClusterFunctionsBash() ...")
120-
mdebug(paste(c(output, ""), collapse = "\n"))
117+
mdebug_push("makeClusterFunctionsBash() -> submitJob() ...")
121118
on.exit(mdebug_pop())
122119
}
120+
121+
script <- cfBrewTemplate(reg, text = template_text, jc = jc)
122+
if (debug) {
123+
mdebugf("job script: %s\n", script)
124+
bfr <- readLines(script, warn = FALSE)
125+
mdebugf("[job script]: %s\n", bfr)
126+
}
127+
128+
output <- system2(bin, args = c(script), stdout = TRUE, stderr = TRUE, wait = TRUE)
129+
if (debug) {
130+
mdebug(paste(c(sprintf("[job output]: %s", output), ""), collapse = "\n"))
131+
}
123132

124133
status <- attr(output, "status")
134+
if (debug) {
135+
mstr(list(status = status))
136+
}
125137
if (is.null(status)) {
126138
status <- 0L
127139
batch.id <- sprintf("bash#%d", Sys.getpid())

0 commit comments

Comments
 (0)