Skip to content

Commit c5a2941

Browse files
PERFORMANCE: result() temporarily sets 'fs.latency = 1.0' second when calling batchtools::getLog()
1 parent 03cb67b commit c5a2941

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
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.10.0-9027
2+
Version: 0.10.0-9028
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

NEWS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@
4343

4444
* Add a template file for SGE.
4545

46+
## Miscellaneous
47+
48+
* `result()` for HPC batchtools backends would use a timeout of
49+
`fs.latency` seconds (as set for the cluster functions) when trying
50+
to collect the logged output. However, since it has already
51+
collected the results, the log file should be available already and
52+
there would be no need to have to wait for the log file to appear.
53+
Because of this, we temporarily set `fs.latency = 1.0` (second)
54+
timeout for trying to find the log file. This makes a big
55+
difference in case the template used a `--output=<path>` location
56+
other than `--output=<%= log.file %>`l in such cases the log file
57+
would not be found, requiring a timeout.
58+
4659
## Bug Fixes
4760

4861
* Using `plan(batchtools_nnn, finalize = FALSE)` would give a warning

R/BatchtoolsFuture-class.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,10 @@ await <- function(future, cleanup = TRUE,
580580
if (inherits(result, "FutureResult")) {
581581
prototype_fields <- c(prototype_fields, "batchtools_log")
582582
result[["batchtools_log"]] <- try({
583+
## Since we're already collected the results, the log file
584+
## should already exist, if it exists. Because of this,
585+
## only poll for the log file for a second before giving up.
586+
reg$cluster.functions$fs.latency <- 1.0
583587
mdebug("- batchtools::getLog() ...")
584588
on.exit(mdebug("- batchtools::getLog() ... done"))
585589
getLog(id = jobid, reg = reg)

0 commit comments

Comments
 (0)