Evaluates an R Expression on One or More Hosts

on_hostname(hostnames, expr, ..., on_error = c("stop", "asis"), cache = FALSE)

Arguments

hostnames

A character vector of hostnames.

expr

The R expression to be evaluated on each host.

on_error

A character string specifying how to handle errors. If "stop" (default), then the error is relayed. If "asis", then the error (the base::condition object) is returned.

cache

If TRUE, cached results on file are considered.

...

(optional) Additional arguments passed to future::future().

Value

A named list with names hostnames.

Details

This function utilizes the future framework and specifically the future.batchtools package to evaluate the expression on a particular host by submitting it via the SGE scheduler.

Examples

if (FALSE) { # \dontrun{
q <- available(queues())
hostnames <- sort(unique(q$hostname))
si <- on_hostname(hostnames, system_info())
print(si)
} # }