Skip to content

Commit ede01c2

Browse files
Merge branch 'release/0.7.2'
2 parents d518ae8 + 2a2d13b commit ede01c2

21 files changed

+332
-162
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: future.batchtools
2-
Version: 0.7.1
2+
Version: 0.7.2
33
Depends:
44
R (>= 3.2.0),
5-
future (>= 1.8.1)
5+
future (>= 1.10.0)
66
Imports:
77
batchtools (>= 0.9.8)
88
Suggests:
@@ -25,5 +25,5 @@ License: LGPL (>= 2.1)
2525
LazyLoad: TRUE
2626
URL: https://github.com/HenrikBengtsson/future.batchtools
2727
BugReports: https://github.com/HenrikBengtsson/future.batchtools/issues
28-
RoxygenNote: 6.0.1
28+
RoxygenNote: 6.1.1
2929
Roxygen: list(markdown = TRUE)

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ S3method(nbrOfWorkers,batchtools)
99
S3method(print,BatchtoolsFuture)
1010
S3method(resolved,BatchtoolsFuture)
1111
S3method(result,BatchtoolsFuture)
12+
S3method(run,BatchtoolsFuture)
1213
S3method(status,BatchtoolsFuture)
1314
export("%resources%")
1415
export(BatchtoolsFuture)
@@ -55,6 +56,7 @@ importFrom(future,nbrOfWorkers)
5556
importFrom(future,plan)
5657
importFrom(future,resolved)
5758
importFrom(future,result)
59+
importFrom(future,run)
5860
importFrom(future,tweak)
5961
importFrom(utils,capture.output)
6062
importFrom(utils,file_test)

NEWS

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
Package: future.batchtools
22
==========================
33

4+
Version: 0.7.2 [2018-12-03]
5+
6+
DOCUMENTATION:
7+
8+
* Add a simple example(future_custom).
9+
10+
FIXES:
11+
12+
* Made internal code agile to upcoming changes in the future package on
13+
how a captured error is represented.
14+
15+
SOFTWARE QUALITY:
16+
17+
* FYI: Every release is tested against one Torque/PBS and one SGE scheduler.
18+
19+
BUG FIXES:
20+
21+
* resolve() on a lazy batchtools future would stall and never return.
22+
23+
424
Version: 0.7.1 [2018-07-18]
525

626
NEW FEATURES:
727

8-
o The batchtools_* backends support the handling of the standard output as
28+
* The batchtools_* backends support the handling of the standard output as
929
implemented in future (>= 1.9.0).
1030

1131
BUG FIXES:
1232

13-
o A bug was introduced in future.batchtools 0.7.0 that could result in "Error
33+
* A bug was introduced in future.batchtools 0.7.0 that could result in "Error
1434
in readLog(id, reg = reg) : Log file for job with id 1 not available" when
1535
using one of the batchtools backends. It occurred when the value was
1636
queried. It was observered using 'batchtools_torque' but not when using
@@ -22,7 +42,7 @@ Version: 0.7.0 [2018-05-03]
2242

2343
NEW FEATURES:
2444

25-
o Argument 'workers' of future strategies may now also be a function, which
45+
* Argument 'workers' of future strategies may now also be a function, which
2646
is called without argument when the future strategy is set up and used as
2747
is. For instance, plan(callr, workers = halfCores) where
2848
halfCores <- function() { max(1, round(availableCores() / 2)) } will use
@@ -31,91 +51,91 @@ NEW FEATURES:
3151

3252
CODE REFACTORING:
3353

34-
o Preparing for futures to gather a richer set of results from batchtools
54+
* Preparing for futures to gather a richer set of results from batchtools
3555
backends.
3656

3757

3858
Version: 0.6.0 [2017-09-10]
3959

4060
NEW FEATURES:
4161

42-
o If the built-in attempts of batchtools for finding a default template file
62+
* If the built-in attempts of batchtools for finding a default template file
4363
fails, then system("templates", package = "future.batchtools") is searched
4464
for template files as well. Currently, there exists a `torque.tmpl` file.
4565

46-
o A job's name in the scheduler is now set as the future's label (requires
66+
* A job's name in the scheduler is now set as the future's label (requires
4767
batchtools 0.9.4 or newer). If no label is specified, the default job name
4868
is controlled by batchtools.
4969

50-
o The period between each poll of the scheduler to check whether a future
70+
* The period between each poll of the scheduler to check whether a future
5171
(job) is finished or not now increases geometrically as a function of number
5272
of polls. This lowers the load on the scheduler for long running jobs.
5373

54-
o The error message for expired batchtools futures now include the last few
74+
* The error message for expired batchtools futures now include the last few
5575
lines of the logged output, which sometimes includes clues on why the future
5676
expired. For instance, if a TORQUE/PBS job use more than the allocated
5777
amount of memory it might be terminated by the scheduler leaving the message
5878
"PBS: job killed: vmem 1234000 exceeded limit 1048576" in the output.
5979

60-
o print() for BatchtoolsFuture returns the object invisibly.
80+
* print() for BatchtoolsFuture returns the object invisibly.
6181

6282
BUG FIXES:
6383

64-
o Calling future_lapply() with functions containing globals part of non-default
84+
* Calling future_lapply() with functions containing globals part of non-default
6585
packages would when using batchtools futures give an error complaining that
6686
the global is missing. This was due to updates in future (>= 1.4.0) that
6787
broke this package.
6888

69-
o loggedOutput() for BatchtoolsFuture would always return NULL unless an error
89+
* loggedOutput() for BatchtoolsFuture would always return NULL unless an error
7090
had occurred.
7191

7292

7393
Version: 0.5.0 [2017-06-02]
7494

75-
o First version submitted to CRAN.
95+
* First version submitted to CRAN.
7696

7797
SOFTWARE QUALITY:
7898

79-
o Added more tests; test coverage now at 93%.
99+
* Added more tests; test coverage now at 93%.
80100

81101

82102
Version: 0.4.0 [2017-05-16]
83103

84104
NEW FEATURES:
85105

86-
o Added batchtools_custom() for specifying batchtools futures using any type
106+
* Added batchtools_custom() for specifying batchtools futures using any type
87107
of batchtools cluster functions.
88108

89-
o batchtools_template(pathname = NULL, type = <type>) now relies on the
109+
* batchtools_template(pathname = NULL, type = <type>) now relies on the
90110
batchtools package for locating the <type> template file.
91111

92-
o nbrOfWorkers() for batchtools futures now defaults to +Inf unless the
112+
* nbrOfWorkers() for batchtools futures now defaults to +Inf unless the
93113
evaluator's 'workers' or 'cluster.functions' specify something else.
94114

95-
o Renamed argument 'pathname' to 'template' for batchtools_<tmpl>() functions.
115+
* Renamed argument 'pathname' to 'template' for batchtools_<tmpl>() functions.
96116

97117
BUG FIXES:
98118

99-
o Under plan(batchjobs_*), when being created futures would produce an error
119+
* Under plan(batchjobs_*), when being created futures would produce an error
100120
on "all(is.finite(workers)) is not TRUE" due to an outdated sanity check.
101121

102122
SOFTWARE QUALITY:
103123

104-
o TESTS: Added test of future_lapply() for batchtools backends.
124+
* TESTS: Added test of future_lapply() for batchtools backends.
105125

106-
o TESTS: Added optional tests for batchjobs_* HPC schedulers listed in
126+
* TESTS: Added optional tests for batchjobs_* HPC schedulers listed in
107127
environment variable 'R_FUTURE_TESTS_STRATEGIES'.
108128

109129
CODE REFACTORING:
110130

111-
o CLEANUP: Package no longer depends on R.utils.
131+
* CLEANUP: Package no longer depends on R.utils.
112132

113133

114134
Version: 0.3.0 [2017-03-19]
115135

116136
NEW FEATURES:
117137

118-
o The number of jobs one can add to the queues of HPC schedulers is in
138+
* The number of jobs one can add to the queues of HPC schedulers is in
119139
principle unlimited, which is why the number of available workers for such
120140
batchtools_* backends is reported as +Inf. However, as the number of
121141
workers is used by future_lapply() to decide how many futures should be used
@@ -128,14 +148,14 @@ Version: 0.2.0 [2017-02-23]
128148

129149
GLOBALS:
130150

131-
o batchtools (>= 0.9.2) now supports exporting objects with any type of names
151+
* batchtools (>= 0.9.2) now supports exporting objects with any type of names
132152
(previously only possible if they mapped to to strictly valid filenames).
133153
This allowed me to avoid lots of internal workaround code encoding and
134154
decoding globals.
135155

136156

137157
Version: 0.1.0 [2017-02-11]
138158

139-
o Package created by porting the code of future.BatchJobs. This version passes
159+
* Package created by porting the code of future.BatchJobs. This version passes
140160
'R CMD check --as-cran' with all OK after a minimal amount of adjustments
141161
to the ported code.

R/BatchtoolsFuture-class.R

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ status.BatchtoolsFuture <- function(future, ...) {
198198

199199
result <- future$result
200200
if (inherits(result, "FutureResult")) {
201-
condition <- result$condition
202-
if (inherits(condition, "error")) status <- c("error", status)
201+
if (result_has_errors(result)) status <- unique(c("error", status))
203202
}
204203

205204
status
@@ -312,10 +311,9 @@ result.BatchtoolsFuture <- function(future, cleanup = TRUE, ...) {
312311
}
313312

314313

315-
run <- function(...) UseMethod("run")
316-
317-
#' @importFrom future getExpression
314+
#' @importFrom future run getExpression
318315
#' @importFrom batchtools batchExport batchMap saveRegistry setJobNames
316+
#' @export
319317
run.BatchtoolsFuture <- function(future, ...) {
320318
if (future$state != "created") {
321319
label <- future$label
@@ -504,9 +502,7 @@ await.BatchtoolsFuture <- function(future, cleanup = TRUE,
504502
result[["batchtools_log"]] <- try({
505503
getLog(id = jobid, reg = reg)
506504
}, silent = TRUE)
507-
if (inherits(result$condition, "error")) {
508-
cleanup <- FALSE
509-
}
505+
if (result_has_errors(result)) cleanup <- FALSE
510506
}
511507
} else if ("error" %in% stat) {
512508
cleanup <- FALSE
@@ -637,7 +633,7 @@ delete.BatchtoolsFuture <- function(future,
637633
status <- status(future)
638634
res <- future$result
639635
if (inherits(res, "FutureResult")) {
640-
if (inherits(res$condition, "error")) status <- "error"
636+
if (result_has_errors(res)) status <- unique(c("error", status))
641637
}
642638
mdebug("delete(): status(<future>) = %s",
643639
paste(sQuote(status), collapse = ", "))

R/batchtools_custom.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#'
1313
#' @return An object of class `BatchtoolsFuture`.
1414
#'
15+
#' @example incl/batchtools_custom.R
16+
#'
1517
#' @export
1618
#' @importFrom utils file_test
1719
batchtools_custom <- function(expr, envir = parent.frame(), substitute = TRUE,

R/utils.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,18 @@ tempvar <- function(prefix = "var", value = NA, envir = parent.frame()) {
170170
# Failed to find a unique temporary variable name
171171
stop(sprintf("Failed to generate a unique non-existing temporary variable with prefix '%s'", prefix)) #nolint
172172
}
173+
174+
175+
176+
result_has_errors <- function(result) {
177+
stop_if_not(inherits(result, "FutureResult"))
178+
179+
## BACKWARD COMPATIBILITY: future (< 1.11.0)
180+
if (inherits(result$condition, "error")) return(TRUE)
181+
182+
for (c in result$conditions) {
183+
if (inherits(c$condition, "error")) return(TRUE)
184+
}
185+
186+
FALSE
187+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Contributing to this package is easy. Just send a [pull request](https://help.g
213213
214214
## Software status
215215
216-
| Resource: | CRAN | Travis CI | Appveyor |
216+
| Resource: | CRAN | Travis CI | AppVeyor |
217217
| ------------- | ------------------- | --------------- | ---------------- |
218218
| _Platforms:_ | _Multiple_ | _Linux & macOS_ | _Windows_ |
219219
| R CMD check | <a href="https://cran.r-project.org/web/checks/check_results_future.batchtools.html"><img border="0" src="http://www.r-pkg.org/badges/version/future.batchtools" alt="CRAN version"></a> | <a href="https://travis-ci.org/HenrikBengtsson/future.batchtools"><img src="https://travis-ci.org/HenrikBengtsson/future.batchtools.svg" alt="Build status"></a> | <a href="https://ci.appveyor.com/project/HenrikBengtsson/future-batchtools"><img src="https://ci.appveyor.com/api/projects/status/github/HenrikBengtsson/future.batchtools?svg=true" alt="Build status"></a> |

cran-comments.md

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,56 @@
1-
# CRAN submission future.batchtools 0.7.1
1+
# CRAN submission future.batchtools 0.7.2
22

3-
on 2018-07-18
3+
on 2019-01-03
44

5-
## Submission 1
5+
Thanks in advance.
66

7-
Thanks in advance
8-
9-
## Submission 2
10-
11-
Resubmission of future.batchtools 0.7.1 where the overall R CMD check time has been decreased significantly.
127

8+
## Notes not sent to CRAN
139

1410
### R CMD check --as-cran validation
1511

1612
The package has been verified using `R CMD check --as-cran` on:
1713

18-
* Platform x86_64-apple-darwin15.6.0 (64-bit) [r-hub; single-core]:
19-
- R version 3.5.0 (2018-04-23)
14+
* Platform x86_64-apple-darwin15.6.0 (64-bit) [Travis CI]:
15+
- R version 3.4.4 (2017-01-27)
16+
- R version 3.5.2 (2018-12-20)
2017

2118
* Platform x86_64-unknown-linux-gnu (64-bit) [Travis CI]:
2219
- R version 3.4.4 (2017-01-27)
23-
- R version 3.5.0 (2017-01-27)
24-
- R Under development (unstable) (2018-06-20 r74923)
20+
- R version 3.5.1 (2018-07-02)
21+
- R Under development (unstable) (2019-01-02 r75944)
2522

2623
* Platform x86_64-pc-linux-gnu (64-bit) [r-hub]:
2724
- R version 3.4.4 (2018-03-15)
28-
- R Under development (unstable) (2018-07-16 r74967)
29-
25+
- R Under development (unstable) (2018-12-22 r75884)
26+
3027
* Platform x86_64-pc-linux-gnu (64-bit):
31-
- R version 3.2.0 (2015-04-16)
32-
- R version 3.3.0 (2016-05-03)
33-
- R version 3.4.0 (2017-04-21)
34-
- R version 3.5.0 (2018-04-23)
28+
- R version 3.2.0 (2015-04-16) w/ Torque/PBS scheduler
29+
- R version 3.3.0 (2016-05-03) w/ Torque/PBS scheduler
30+
- R version 3.5.0 (2018-04-23) w/ Torque/PBS scheduler
3531
- R version 3.5.1 (2018-07-02)
32+
- R version 3.5.1 (2018-07-02) w/ SGE scheduler
33+
- R version 3.5.2 (2018-12-20) w/ Torque/PBS scheduler
3634

37-
* Platform i386-w64-mingw32 (32-bit) (64-bit) [Appveyor CI]:
38-
- R Under development (unstable) (2018-07-16 r74967)
35+
* Platform i686-pc-linux-gnu (32-bit):
36+
- R version 3.4.4 (2018-03-15)
3937

40-
* Platform x86_64-w64-mingw32/x64 (64-bit) [Appveyor CI]:
41-
- R version 3.5.1 (2018-07-02)
42-
- R Under development (unstable) (2018-07-16 r74967)
38+
* Platform i386-w64-mingw32 (32-bit) [Appveyor CI]:
39+
- R Under development (unstable) (2018-10-12 r75434)
4340

4441
* Platform x86_64-w64-mingw32 (64-bit) [r-hub]:
45-
- R Under development (unstable) (2018-07-16 r74967)
42+
- R Under development (unstable) (2018-12-26 r75909)
4643

47-
* Platform x86_64-w64-mingw32/x64 (64-bit) [win-builder]:
48-
- R version 3.5.1 (2018-07-02)
49-
- R Under development (unstable) (2018-07-16 r74967)
50-
51-
52-
The following setups were skipped due to non-availability:
53-
54-
* Platform x86_64-apple-darwin13.4.0 (64-bit) [Travis CI]:
55-
- R version 3.4.4 (2017-01-27)
44+
* Platform x86_64-w64-mingw32/x64 (64-bit) [Appveyor CI]:
45+
- R version 3.5.2 (2018-12-20)
46+
- R Under development (unstable) (2018-12-29 r75924)
5647

57-
* Platform x86_64-apple-darwin15.6.0 (64-bit) [Travis CI]:
58-
- R version 3.5.0 (2018-04-23)
48+
* Platform x86_64-w64-mingw32/x64 (64-bit) [win-builder]:
49+
- R version 3.5.2 (2018-12-20)
50+
- R Under development (unstable) (2019-01-01 r75943)
5951

60-
* Platform i686-pc-linux-gnu (32-bit):
61-
- R version 3.4.4 (2018-03-15)
52+
Failed to test:
6253

63-
* Platform i686-pc-linux-gnu (32-bit):
64-
- R version 3.4.4 (2018-03-15)
54+
* Platform i386-pc-solaris2.10 (32-bit):
55+
- R version 3.5.0 Patched (2018-04-30 r74674)
56+
REASON: 'stringi' package failed to install

incl/batchtools_custom.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cf <- batchtools::makeClusterFunctionsInteractive(external = TRUE)
2+
plan(batchtools_custom, cluster.functions = cf)
3+
4+
## Create explicit future
5+
f <- future({
6+
cat("PID:", Sys.getpid(), "\n")
7+
42L
8+
})
9+
v <- value(f)
10+
print(v)

0 commit comments

Comments
 (0)