@@ -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