Skip to content

Commit 46bf1e1

Browse files
Make use of the new parallelly (>= 1.44.0) features
1 parent 29c2fea commit 46bf1e1

7 files changed

+11
-25
lines changed

DESCRIPTION

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.40.0-9315
2+
Version: 1.40.0-9400
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)
@@ -8,15 +8,16 @@ Imports:
88
globals (>= 0.16.1),
99
listenv (>= 0.8.0),
1010
parallel,
11-
parallelly (>= 1.43.0),
11+
parallelly (>= 1.44.0),
1212
utils
1313
Suggests:
1414
methods,
1515
RhpcBLASctl,
1616
R.rsp,
1717
markdown
1818
Remotes:
19-
futureverse/globals@develop
19+
futureverse/parallelly,
20+
futureverse/globals
2021
VignetteBuilder: R.rsp
2122
Authors@R: c(person("Henrik", "Bengtsson",
2223
role = c("aut", "cre", "cph"),

NAMESPACE

-3
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@ export(supportsMulticore)
196196
export(tweak)
197197
export(validateFutureGlobals)
198198
export(value)
199-
if (packageVersion("parallelly") <= "1.43.0") {
200-
S3method(all.equal,connection)
201-
}
202199
importFrom(digest,digest)
203200
importFrom(globals,Globals)
204201
importFrom(globals,as.Globals)

NEWS.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
on the total and average runtime of all finished futures thus far.
2828

2929
* Now `plan(multisession)` defaults to
30-
`parallelly::availableCores(constraints = "connections")`
30+
`parallelly::availableCores(constraints = "connections-16")`
3131
workers. This is done to make sure to not use more parallel workers
32-
than the number of connections available in R, because each
32+
than the number of connections available in R, and to leave 16
33+
connections available for other needs. This is because each
3334
parallel PSOCK worker requires its own R connections. Previously,
3435
it would attempt to launch even more workers on machines with a
3536
large number of CPU cores, e.g. 128, 196, and 256 CPU-core

R/backend_api-13.MultisessionFutureBackend-class.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#' @keywords internal
1010
#' @rdname FutureBackend
1111
#' @export
12-
MultisessionFutureBackend <- function(workers = availableCores(constraints = "connections"), rscript_libs = .libPaths(), interrupts = TRUE, gc = FALSE, earlySignal = FALSE, ...) {
12+
MultisessionFutureBackend <- function(workers = availableCores(constraints = "connections-16"), rscript_libs = .libPaths(), interrupts = TRUE, gc = FALSE, earlySignal = FALSE, ...) {
1313
debug <- isTRUE(getOption("future.debug"))
1414
if (debug) {
1515
mdebugf_push("MultisessionFutureBackend(workers = <workers>, interrupts = %s, ...) ...", interrupts)
@@ -124,7 +124,7 @@ print.MultisessionFutureBackend <- function(x, validate = TRUE, ...) {
124124
#' cores that are available for the current \R session.
125125
#'
126126
#' @export
127-
multisession <- function(..., workers = availableCores(constraints = "connections"), lazy = FALSE, rscript_libs = .libPaths(), gc = FALSE, earlySignal = FALSE, envir = parent.frame()) {
127+
multisession <- function(..., workers = availableCores(constraints = "connections-16"), lazy = FALSE, rscript_libs = .libPaths(), gc = FALSE, earlySignal = FALSE, envir = parent.frame()) {
128128
## WORKAROUNDS:
129129
## (1) promises::future_promise() calls the "evaluator" function directly
130130
if ("promises" %in% loadedNamespaces()) {

R/utils-connections.R

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
#' @rawNamespace if (packageVersion("parallelly") <= "1.43.0") {
2-
#' S3method(all.equal,connection)
3-
#' }
4-
if (packageVersion("parallelly") <= "1.43.0") {
5-
all.equal.connection <- function(target, current, ...) {
6-
if (!identical(target, current)) {
7-
return("Connections differ")
8-
}
9-
TRUE
10-
}
11-
}
12-
13-
141
## This is needed in order to be able to assert that we later
152
## actually work with the same connection. See R-devel thread
163
## 'closeAllConnections() can really mess things up' on 2016-10-30

man/FutureBackend.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/multisession.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)