callFunctionOnSSHWorkers {BatchJobs}R Documentation

Call an arbitrary function on specified SSH workers.

Description

Calls can be made in parallel or consecutively, the function waits until all calls have finished and returns call results. In consecutive mode the output on the workers can also be shown on the master during computation.

Please read and understand the comments for argument dir.

Note that this function should only be used for short administrative tasks or information gathering on the workers, the true work horse for real computation is submitJobs.

In makeSSHWorker various options for load management are possible. Note that these will be ignored for the current call to execute it immediatly.

Usage

callFunctionOnSSHWorkers(
  nodenames,
  fun,
  ...,
  consecutive = FALSE,
  show.output = consecutive,
  simplify = TRUE,
  use.names = TRUE,
  dir = getwd()
)

Arguments

nodenames

[character]
Nodenames of workers to call function on. Only workers which were specified in your makeClusterFunctionsSSH configuration can be used.

fun

[function]
Function to call on workers.

...

[any]
Arguments for fun.

consecutive

[logical(1)]
Do calls consecutively and always wait until each worker is done. Default is FALSE.

show.output

[logical(1)]
Show output of workers on master during call. Can be useful to see what is happening. Can only be used in consecutive mode. Default is consecutive.

simplify

[logical(1)]
Should the result be simplified? See sapply. Default is TRUE.

use.names

[logical(1)]
Name results by nodenames. Default is TRUE.

dir

[character(1)]
Directory under which a temporary registry will be created in a subdirectory for communication. This has to be somewhere on the shared filesystem. The created subdirectory will be cleaned up on exit. Default is current working directory.

Value

Results of function calls, either a list or simplified.


[Package BatchJobs version 1.9 Index]