Skip to content

Commit eb5098a

Browse files
Explicitly specify package namespace when using plan(), e.g. plan(future.batchtools::batchtools_sge) instead of just plan(batchtools_sge). The idea is that backend packages should not really be attached
1 parent 1bbb596 commit eb5098a

22 files changed

+63
-59
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-9932
2+
Version: 0.12.2-9933
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

NEWS.md

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555

5656
## Bug Fixes
5757

58-
* `plan(batchtools_multicore)` did not support `workers` argument
59-
being a function.
58+
* `plan(future.batchtools::batchtools_multicore)` did not support
59+
`workers` argument being a function.
6060

6161

6262
# Version 0.12.0 [2023-02-24]
@@ -93,12 +93,12 @@
9393

9494
* It is now possible to tweak arguments used by an underlying
9595
`batchtools::makeClusterFunctionsNnn()` function for some of the
96-
`batchtools_nnn` backends, e.g. `plan(batchtools_slurm,
97-
scheduler.latency = 60)`.
96+
`batchtools_nnn` backends, e.g.
97+
`plan(future.batchtools::batchtools_slurm, scheduler.latency = 60)`.
9898

99-
* `plan(batchtools_multicore, workers = I(1))` overrides the fallback
100-
to `batchtools_local` and forces a single `batchtools_multicore`
101-
worker.
99+
* `plan(future.batchtools::batchtools_multicore, workers = I(1))`
100+
overrides the fallback to `batchtools_local` and forces a single
101+
`batchtools_multicore` worker.
102102

103103
* `print()` for BatchtoolsFuture now reports on the batchtools
104104
configuration file (an R script) and the the batchtools job template
@@ -142,8 +142,9 @@
142142

143143
## Bug Fixes
144144

145-
* Using `plan(batchtools_nnn, finalize = FALSE)` would give a warning
146-
on `Detected 1 unknown future arguments: 'finalize'`.
145+
* Using `plan(future.batchtools::batchtools_nnn, finalize = FALSE)`
146+
would give a warning on `Detected 1 unknown future arguments:
147+
'finalize'`.
147148

148149
* Template files in `system.file(package = "future.batchtools",
149150
"templates")` were not found.
@@ -198,34 +199,36 @@
198199
`future.batchtools.workers` or environment variable
199200
`R_FUTURE_BATCHTOOLS_WORKERS`.
200201

201-
* It is now possible to configure the **batchtools** registries that are
202-
used by batchtools futures via new argument `registry` to `plan()`.
203-
This argument should be a named list of parameters recognized by
204-
the **batchtools** package, e.g. `plan(batchtools_sge, registry =
202+
* It is now possible to configure the **batchtools** registries that
203+
are used by batchtools futures via new argument `registry` to
204+
`plan()`. This argument should be a named list of parameters
205+
recognized by the **batchtools** package,
206+
e.g. `plan(future.batchtools::batchtools_sge, registry =
205207
list(...))`. For notable example, see below news entries.
206208

207209
* The default working directory for batchtools futures is the current
208210
working directory of R _when_ the batchtools future is created.
209-
This corresponds to specifying `plan(batchtools_nnn, registry =
210-
list(work.dir = NULL)`. Sometimes it is useful to use a explicit
211-
working directory that is guaranteed to be available on all workers
212-
on a shared file system, e.g. `plan(batchtools_nnn, registry =
211+
This corresponds to specifying
212+
`plan(future.batchtools::batchtools_nnn, registry = list(work.dir =
213+
NULL)`. Sometimes it is useful to use a explicit working directory
214+
that is guaranteed to be available on all workers on a shared file
215+
system, e.g. `plan(future.batchtools::batchtools_nnn, registry =
213216
list(work.dir = "~"))`.
214217

215218
* It is possible to control if and how **batchtools** should use file
216219
compression for exported globals and results by specifying
217-
**batchtools** registry parameter `compress`. For example, to turn off
218-
file compression, use `plan(batchtools_nnn, registry =
219-
list(compress = FALSE))`.
220+
**batchtools** registry parameter `compress`. For example, to turn
221+
off file compression, use `plan(future.batchtools::batchtools_nnn,
222+
registry = list(compress = FALSE))`.
220223

221224
* The default location of the `.future` folder can be controlled by R
222225
option `future.cache.path` or environment variable
223226
`R_FUTURE_CACHE_PATH`.
224227

225228
* `batchtools_custom()` and BatchtoolsFuture gained argument
226-
`conf.file`. Using `plan(batchtools_custom)` will now use any
227-
**batchtools** configuration file (an R script) found on the
228-
`batchtools::findConfFile()` search path.
229+
`conf.file`. Using `plan(future.batchtools::batchtools_custom)`
230+
will now use any **batchtools** configuration file (an R script)
231+
found on the `batchtools::findConfFile()` search path.
229232

230233

231234
## Documentation
@@ -322,10 +325,11 @@
322325

323326
* Argument `workers` of future strategies may now also be a function,
324327
which is called without argument when the future strategy is set up
325-
and used as-is. For instance, `plan(callr, workers = halfCores)`
326-
where `halfCores <- function() { max(1, round(availableCores() /
327-
2)) }` will use half of the number of available cores. This is
328-
useful when using nested future strategies with remote machines.
328+
and used as-is. For instance, `plan(future.callr::callr, workers =
329+
halfCores)` where `halfCores <- function() { max(1,
330+
round(availableCores() / 2)) }` will use half of the number of
331+
available cores. This is useful when using nested future
332+
strategies with remote machines.
329333

330334

331335
## Code Refactoring
@@ -395,9 +399,9 @@
395399

396400
## Bug Fixes
397401

398-
* Under `plan(batchtools_*)`, when being created futures would
399-
produce an error on `all(is.finite(workers)) is not TRUE` due to an
400-
outdated sanity check.
402+
* Under `plan(future.batchtools::batchtools_nnn)`, when being created
403+
futures would produce an error on `all(is.finite(workers)) is not
404+
TRUE` due to an outdated sanity check.
401405

402406

403407
## Software Quality
@@ -424,8 +428,8 @@
424428
decide how many futures should be used to best partition the
425429
elements, this means that `future_lapply()` will always use one
426430
future per element. Because of this, it is now possible to specify
427-
`plan(batchtools_*, workers = n)` where `n` is the target number of
428-
workers.
431+
`plan(future.batchtools::batchtools_nnn, workers = n)` where `n` is
432+
the target number of workers.
429433

430434

431435
# Version 0.2.0 [2017-02-23]

R/batchtools_interactive.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ BatchtoolsInteractiveFutureBackend <- function(fs.latency = 0.0, ...) {
3737
#' sequentially and that also can be debugged interactively.
3838
#'
3939
#' @examples
40-
#' plan(batchtools_interactive)
40+
#' plan(future.batchtools::batchtools_interactive)
4141
#'
4242
#' message("Main process ID: ", Sys.getpid())
4343
#'

R/batchtools_local.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ BatchtoolsLocalFutureBackend <- function(fs.latency = 0.0, ...) {
6969
#' `plan(future::cluster, workers = I(1))`.
7070
#'
7171
#' @examples
72-
#' plan(batchtools_local)
72+
#' plan(future.batchtools::batchtools_local)
7373
#'
7474
#' message("Main process ID: ", Sys.getpid())
7575
#'

R/batchtools_lsf.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ BatchtoolsLsfFutureBackend <- function(...) {
3636
#'
3737
#' @examplesIf interactive()
3838
#' # Limit runtime to 3 minutes and memory to 200 MiB per future
39-
#' plan(batchtools_lsf, resources = list(W = "00:03:00", M = "200"))
39+
#' plan(future.batchtools::batchtools_lsf, resources = list(W = "00:03:00", M = "200"))
4040
#'
4141
#' message("Main process ID: ", Sys.getpid())
4242
#'

R/batchtools_multicore.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ BatchtoolsMulticoreFutureBackend <- function(workers = availableCores(constraint
8888
#' `plan(future::multicore)`.
8989
#'
9090
#' @examples
91-
#' plan(batchtools_multicore, workers = 2)
91+
#' plan(future.batchtools::batchtools_multicore, workers = 2)
9292
#'
9393
#' message("Main process ID: ", Sys.getpid())
9494
#'

R/batchtools_openlava.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ BatchtoolsOpenLavaFutureBackend <- function(...) {
3636
#'
3737
#' @examplesIf interactive()
3838
#' # Limit runtime to 3 minutes and memory to 200 MiB per future
39-
#' plan(batchtools_lsf, resources = list(W = "00:03:00", M = "200"))
39+
#' plan(future.batchtools::batchtools_lsf, resources = list(W = "00:03:00", M = "200"))
4040
#'
4141
#' message("Main process ID: ", Sys.getpid())
4242
#'

R/batchtools_sge.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ BatchtoolsSGEFutureBackend <- function(...) {
3535
#'
3636
#' @examplesIf interactive()
3737
#' # Limit runtime to 3 minutes and memory to 200 MiB per future
38-
#' plan(batchtools_sge, resources = list(h_rt = "00:03:00", mem_free = "200M"))
38+
#' plan(future.batchtools::batchtools_sge, resources = list(h_rt = "00:03:00", mem_free = "200M"))
3939
#'
4040
#' message("Main process ID: ", Sys.getpid())
4141
#'

R/batchtools_slurm.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ BatchtoolsSlurmFutureBackend <- function(...) {
3636
#'
3737
#' @examplesIf interactive()
3838
#' # Limit runtime to 3 minutes and memory to 200 MiB per future
39-
#' plan(batchtools_slurm, resources = list(time = "00:03:00", mem = "200M"))
39+
#' plan(future.batchtools::batchtools_slurm, resources = list(time = "00:03:00", mem = "200M"))
4040
#'
4141
#' message("Main process ID: ", Sys.getpid())
4242
#'

R/batchtools_torque.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ BatchtoolsTorqueFutureBackend <- function(...) {
3535
#'
3636
#' @examplesIf interactive()
3737
#' # Limit runtime to 3 minutes and memory to 200 MiB per future
38-
#' plan(batchtools_torque, resources = list(walltime = "00:03:00", mem = "200mb"))
38+
#' plan(future.batchtools::batchtools_torque, resources = list(walltime = "00:03:00", mem = "200mb"))
3939
#'
4040
#' message("Main process ID: ", Sys.getpid())
4141
#'

0 commit comments

Comments
 (0)