A batchtools backend that resolves futures sequentially in the current R session
Source:R/batchtools_interactive.R
batchtools_interactive.RdThe batchtools interactive backend is useful for verifying parts of your batchtools setup locally, while still being able to do interactive debugging.
Arguments
- fs.latency
[
numeric(1)]
Expected maximum latency of the file system, in seconds. Set to a positive number for network file systems like NFS which enables more robust (but also more expensive) mechanisms to access files and directories. Usually safe to set to0to disable the heuristic, e.g. if you are working on a local file system.- delete
Controls if and when the batchtools job registry folder is deleted. If
"on-success"(default), it is deleted if the future was resolved successfully and the expression did not produce an error. If"never", then it is never deleted. If"always", then it is always deleted.- registry
(optional) A named list of settings applied to each future's batchtools Registry. This is a more convenient alternative to using argument
conf.file.- finalize
If TRUE, a future's batchtools Registry is automatically deleted when the future is garbage collected, otherwise not.
- ...
Not used.
Details
Batchtools interactive futures use batchtools cluster functions
created by batchtools::makeClusterFunctionsInteractive() with
external = FALSE.
An alternative to the batchtools interactive backend is to use
plan(future::sequential), which is a faster way process futures
sequentially and that also can be debugged interactively.
Examples
library(future)
plan(future.batchtools::batchtools_interactive)
message("Main process ID: ", Sys.getpid())
#> Main process ID: 188715
f <- future({
data.frame(
hostname = Sys.info()[["nodename"]],
os = Sys.info()[["sysname"]],
cores = unname(parallelly::availableCores()),
pid = Sys.getpid(),
modules = Sys.getenv("LOADEDMODULES")
)
})
info <- value(f)
print(info)
#> hostname os cores pid modules
#> 1 runnervm0j63q Linux 2 188715