Skip to content

Commit 937522e

Browse files
CLEANUP: Drop 'future.backend.version' option; we're using version 2 now, if backend supports it
1 parent 8a05a21 commit 937522e

File tree

5 files changed

+1
-114
lines changed

5 files changed

+1
-114
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131

3232
- {os: ubuntu-latest, r: 'release' , availablecores: 1, label: 'availableCores.system=1' }
3333
- {os: ubuntu-latest, r: 'release' , availablecores: 2, label: 'availableCores.system=2' }
34-
- {os: ubuntu-latest, r: 'release' , backend_version: 1, label: 'backend_version=1' }
3534
- {os: ubuntu-latest, r: 'release' , language: ko, label: ko }
3635
- {os: ubuntu-latest, r: 'release' , language: zh_CN, label: zh_CN }
3736
- {os: ubuntu-latest, r: 'release' , language: zh_TW, label: zh_TW }
@@ -60,7 +59,6 @@ jobs:
6059
R_PARALLELLY_AVAILABLECORES_SYSTEM: ${{ matrix.config.availablecores }}
6160
R_FUTURE_RNG_ONMISUSE: error
6261
R_FUTURE_GLOBALS_KEEPWHERE: ${{ matrix.config.globals_keepWhere }}
63-
R_FUTURE_BACKEND_VERSION: ${{ matrix.config.backend_version }}
6462

6563
steps:
6664
- uses: actions/checkout@v4

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ spelling:
1515
future.tests/%:
1616
$(R_SCRIPT) -e "future.tests::check" --args --test-plan=$*
1717

18-
future.tests/future: future.tests/sequential future.tests/multicore future.tests/multisession future.tests/cluster
19-
2018
future.tests/future.mirai: future.tests/future.mirai\:\:mirai_multisession future.tests/future.mirai\:\:mirai_cluster
2119

2220
future.tests/future.callr: future.tests/future.callr\:\:callr
2321

2422
future.tests/future.batchtools: future.tests/future.batchtools\:\:batchtools_local
2523

26-
future.tests: future.tests/future
24+
future.tests: future.tests/sequential future.tests/multicore future.tests/multisession future.tests/cluster

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ S3method(result,ConstantFuture)
7474
S3method(result,Future)
7575
S3method(result,MulticoreFuture)
7676
S3method(result,UniprocessFuture)
77-
S3method(run,ClusterFuture)
7877
S3method(run,ConstantFuture)
7978
S3method(run,Future)
8079
S3method(run,UniprocessFuture)

R/backend_api-ClusterFuture-class.R

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -94,111 +94,6 @@ as_ClusterFuture <- function(future, workers = NULL, ...) {
9494
}
9595

9696

97-
#' @export
98-
run.ClusterFuture <- function(future, ...) {
99-
if (getOption("future.backend.version", 2L) == 2L) {
100-
return(NextMethod())
101-
}
102-
103-
debug <- getOption("future.debug", FALSE)
104-
105-
if (future[["state"]] != 'created') {
106-
label <- future[["label"]]
107-
if (is.null(label)) label <- "<none>"
108-
stop(FutureError(sprintf("A future ('%s') can only be launched once", label), future = future))
109-
}
110-
111-
## Assert that the process that created the future is
112-
## also the one that evaluates/resolves/queries it.
113-
assertOwner(future)
114-
115-
backend <- future[["backend"]]
116-
workers <- backend[["workers"]]
117-
reg <- backend[["reg"]]
118-
119-
data <- getFutureData(future)
120-
persistent <- isTRUE(future[["persistent"]])
121-
122-
## Next available cluster node
123-
t_start <- Sys.time()
124-
node_idx <- requestNode(await = function() {
125-
FutureRegistry(reg, action = "collect-first", earlySignal = TRUE)
126-
}, workers = workers)
127-
future[["node"]] <- node_idx
128-
129-
## Cluster node to use
130-
cl <- workers[node_idx]
131-
132-
if (inherits(future[[".journal"]], "FutureJournal")) {
133-
appendToFutureJournal(future,
134-
event = "getWorker",
135-
category = "overhead",
136-
parent = "launch",
137-
start = t_start,
138-
stop = Sys.time()
139-
)
140-
}
141-
142-
143-
## (i) Reset global environment of cluster node such that
144-
## previous futures are not affecting this one, which
145-
## may happen even if the future is evaluated inside a
146-
## local, e.g. local({ a <<- 1 }).
147-
if (!persistent) {
148-
t_start <- Sys.time()
149-
cluster_call_blocking(cl, fun = grmall, future = future, when = "call grmall() on")
150-
if (inherits(future[[".journal"]], "FutureJournal")) {
151-
appendToFutureJournal(future,
152-
event = "eraseWorker",
153-
category = "overhead",
154-
parent = "launch",
155-
start = t_start,
156-
stop = Sys.time()
157-
)
158-
}
159-
}
160-
161-
162-
## (ii) Attach packages that needs to be attached
163-
## NOTE: Already take care of by evalFuture().
164-
## However, if we need to get an early error about missing packages,
165-
## we can get the error here before launching the future.
166-
t_start <- Sys.time()
167-
packages <- future[["packages"]]
168-
if (future[["earlySignal"]] && length(packages) > 0) {
169-
if (debug) mdebugf("Attaching %d packages (%s) on cluster node #%d ...",
170-
length(packages), hpaste(sQuote(packages)), node_idx)
171-
172-
cluster_call_blocking(cl, fun = requirePackages, packages, future = future, when = "call requirePackages() on")
173-
174-
if (debug) mdebugf("Attaching %d packages (%s) on cluster node #%d ... DONE",
175-
length(packages), hpaste(sQuote(packages)), node_idx)
176-
}
177-
178-
if (inherits(future[[".journal"]], "FutureJournal")) {
179-
appendToFutureJournal(future,
180-
event = "attachPackages",
181-
category = "overhead",
182-
parent = "launch",
183-
start = t_start,
184-
stop = Sys.time()
185-
)
186-
}
187-
188-
## Add to registry
189-
FutureRegistry(reg, action = "add", future = future, earlySignal = FALSE)
190-
191-
## (iv) Launch future
192-
node_call_nonblocking(cl[[1L]], fun = evalFuture, args = list(data), when = "launch future on")
193-
194-
future[["state"]] <- 'running'
195-
196-
if (debug) mdebugf("%s started", class(future)[1])
197-
198-
invisible(future)
199-
}
200-
201-
20297
getSocketSelectTimeout <- function(future, timeout = NULL) {
20398
if (!is.null(timeout)) return(timeout)
20499

R/utils-options.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,4 @@ update_package_options <- function(debug = FALSE) {
362362
## future 1.34.0:
363363
update_package_option("future.globals.objectSize.method", mode = "character", debug = debug)
364364
update_package_option("future.plan.cleanup.legacy", mode = "logical", debug = debug)
365-
366-
## future (>= 1.34.0-9000):
367-
update_package_option("future.backend.version", mode = "integer", default = 2L, debug = debug)
368365
}

0 commit comments

Comments
 (0)