@@ -3,10 +3,19 @@ temp_registry <- local({
33 # # All known batchtools registries
44 regs <- new.env()
55
6- make_registry <- function (conf.file = NULL , cluster.functions = NULL , config = list (), ... ) {
6+ make_registry <- function (cluster.functions = NULL , config = list (), ... ) {
77 # # Temporarily disable batchtools output?
88 # # (i.e. messages and progress bars)
99 debug <- isTRUE(getOption(" future.debug" ))
10+ if (debug ) {
11+ mdebugf_push(" make_registry() ..." )
12+ mdebug(" cluster.functions:" )
13+ mstr(cluster.functions )
14+ mdebug(" config:" )
15+ mstr(config )
16+ on.exit(mdebug_pop())
17+ }
18+
1019 batchtools_output <- getOption(" future.batchtools.output" , debug )
1120
1221 work.dir <- config $ work.dir
@@ -15,13 +24,13 @@ temp_registry <- local({
1524
1625 if (! batchtools_output ) {
1726 oopts <- options(batchtools.verbose = FALSE , batchtools.progress = FALSE )
18- on.exit(options(oopts ))
27+ on.exit(options(oopts ), add = TRUE )
1928 }
2029
2130 # # WORKAROUND: batchtools::makeRegistry() updates the RNG state,
2231 # # which we must make sure to undo.
2332 with_stealth_rng({
24- reg <- makeRegistry(work.dir = work.dir , conf.file = conf.file , ... )
33+ reg <- makeRegistry(work.dir = work.dir , ... )
2534 })
2635
2736 if (! is.null(cluster.functions )) { # ## FIXME
@@ -41,7 +50,13 @@ temp_registry <- local({
4150 reg
4251 } # # make_registry()
4352
44- function (label = " batchtools" , path = NULL , conf.file = NULL , cluster.functions = NULL , config = list (), ... ) {
53+ function (label = " batchtools" , path = NULL , cluster.functions = NULL , config = list (), ... ) {
54+ debug <- isTRUE(getOption(" future.debug" ))
55+ if (debug ) {
56+ mdebugf_push(" temp_registry() ..." )
57+ on.exit(mdebug_pop())
58+ }
59+
4560 if (is.null(label )) label <- " batchtools"
4661 # # The job label (the name on the job queue) - may be duplicated
4762 label <- as.character(label )
@@ -83,7 +98,7 @@ temp_registry <- local({
8398 # # expression "^[a-zA-Z]+[0-9a-zA-Z_]*$".
8499 # # /HB 2016-10-19
85100 reg_id <- as_valid_registry_id(label )
86- make_registry(file.dir = path_registry , conf.file = conf.file , cluster.functions = cluster.functions , config = config , ... )
101+ make_registry(file.dir = path_registry , cluster.functions = cluster.functions , config = config , ... )
87102 }
88103})
89104
0 commit comments