batchtools_multicore: batchtools multicore futures

View source: R/batchtools_multicore.R

batchtools_multicoreR Documentation

batchtools multicore futures

Description

A batchtools multicore future is an asynchronous multiprocess future that will be evaluated in a background R session.

We highly recommend using future::multisession (sic!) futures of the future package instead of multicore batchtools futures.

Usage

batchtools_multicore(
  expr,
  envir = parent.frame(),
  substitute = TRUE,
  globals = TRUE,
  label = NULL,
  workers = availableCores(constraints = "multicore"),
  registry = list(),
  ...
)

Arguments

expr

The R expression to be evaluated

envir

The environment in which global environment should be located.

substitute

Controls whether expr should be substitute():d or not.

globals

(optional) a logical, a character vector, a named list, or a Globals object. If TRUE, globals are identified by code inspection based on expr and tweak searching from environment envir. If FALSE, no globals are used. If a character vector, then globals are identified by lookup based their names globals searching from environment envir. If a named list or a Globals object, the globals are used as is.

label

(optional) Label of the future (where applicable, becomes the job name for most job schedulers).

workers

The number of multicore processes to be available for concurrent batchtools multicore futures.

registry

(optional) A named list of settings to control the setup of the batchtools registry.

...

Additional arguments passed to BatchtoolsFuture().

Details

batchtools multicore futures rely on the batchtools backend set up by batchtools::makeClusterFunctionsMulticore(). The batchtools multicore backend only works on operating systems supporting the ps command-line tool, e.g. Linux and macOS.

Value

An object of class BatchtoolsMulticoreFuture.


HenrikBengtsson/future.batchtools documentation built on Feb. 1, 2024, 7:47 p.m.