View source: R/batchtools_local.R
| batchtools_local | R Documentation |
The batchtools local backend is useful for verifying parts of your batchtools setup locally, before using a more advanced backend such as the job-scheduler backends.
batchtools_local(
...,
fs.latency = 0,
delete = getOption("future.batchtools.delete", "on-success"),
registry = list(),
finalize = getOption("future.finalize", TRUE)
)
fs.latency |
[ |
delete |
Controls if and when the batchtools job registry folder is
deleted.
If |
registry |
(optional) A named list of settings applied to each
future's batchtools Registry.
This is a more convenient alternative to using argument |
finalize |
If TRUE, a future's batchtools Registry is automatically deleted when the future is garbage collected, otherwise not. |
... |
Not used. |
Batchtools local futures use batchtools cluster functions
created by batchtools::makeClusterFunctionsInteractive() with
external = TRUE.
The batchtools local backend is synchronous, that is, the main R process
blocks while a job is running. This means that nothing can be relayed from
a job until it is done. For example, immediate conditions, such as
progress updates signaled by the progressr package, are relayed
first when the job has finished. To get them as soon as possible, use an
asynchronous backend, e.g. batchtools_multicore() with two or more
workers, or a job scheduler.
An alternative to the batchtools local backend is to use
plan(future::cluster, workers = I(1)).
Nothing.
library(future)
plan(future.batchtools::batchtools_local)
message("Main process ID: ", Sys.getpid())
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.