Skip to content

Commit 40e7411

Browse files
tweaks
1 parent 58307d7 commit 40e7411

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
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.12.2-9918
2+
Version: 0.12.2-9919
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

R/BatchtoolsFutureBackend-class.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ launchFuture.BatchtoolsFutureBackend <- local({
209209
})
210210

211211
config <- list(reg = reg)
212+
if (debug) {
213+
mprint(list(config = config))
214+
}
212215
future[["config"]] <- config
213216

214217
## Register finalizer?

R/temp_registry.R

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

inst/templates/slurm.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<% Slurm defaults
99
defaults <- list(
1010
nodes = 1, # single-host processing
11-
time = "00:05:00" # 5-min runtime
11+
time = "00:05:00", # 5-min runtime
1212
mem = "100M" # 100 MiB memory
1313
)
1414
resources <- c(resources, defaults[setdiff(names(defaults), names(resources))])

0 commit comments

Comments
 (0)