.PVM.spawn {rpvm}R Documentation

Spawn child tasks

Description

Starts up ntask copies of an executable file task or slave R processes on the virtual machine.

Usage

.PVM.spawn (task, ntask = 1, flag  = "Default", where = "",
            arglist = NULL, verbose = FALSE)
.PVM.spawnR (slave, ntask = 1, flag  = "Default", where = "",
             slavedir = "demo", outdir = "/tmp", verbose = FALSE)
.PVM.spawnflags

Arguments

task

name of an executable file

ntask

number of tasks to spawn

flag

options flag

where

name of a host or architecture

arglist

a character vectpr to be passed to the spawned task.

slave

name of slave R script

slavedir

full path to the slave script

outdir

full path to the directory where the output from slave R process will be

verbose

if true, print out more information which might be helpful in debugging

Details

flag is a list of strings used to specify options. Allowed values are

"Default" PVM chooses where to spawn processes
"Host" spawn on a particular host (where)
"Arch" spawn on a particular PVM_ARCH (where)
"Debug" starts tasks under a debugger
"Trace" trace data is generated
"MppFront" starts tasks on MPP front-end
"HostCompl" complements host set in where

task is a character string containing the name of the executable file name of the PVM process to be started. It must already reside on the host on which it is to be started and can be find by local pvmd (possibly by specifying ep= option when the host is added, see .PVM.addhosts). The default location PVM looks at is $PVM_ROOT/bin/$PVM_ARCH.

To spawn a R process, one can use the script ‘slaveR.sh’ which has to be included in the search path of pvmd, for example by passing ep="$R_LIBS/rpvm" (the default place this script is installed) to .PVM.addhosts. Note that here "R_LIBS" referes to the R library on the slave node.

.PVM.spawnR can be used to conveniently spawn slave R processes. The paths for the slave script and output file should be given as arguments toslavedir and outdir.

The name of slave script must be given as argument slave. It is crucial that this script is present and can be found on each slave node. The input file path has to be relative to system.file (package = "rpvm") on each node, and it has to be the same on all nodes. The default input path is the "demo" subdirectory of rpvm installed directory.

The output path can be either relative to the home directory or an absolute pathname (the default is "/tmp"). The output file from slave R process will have the same name as the slave script with process id and .Rout appended to it.

.PVM.spawnflags is a mapping of strings to integer constants defined by PVM.

Value

A vector containing tids of successfully spawned processes (the length could be smaller than the number requested) or -1 if there is an system error.

Author(s)

Na (Michael) Li nali@umn.edu and A.J. Rossini rossini@u.washington.edu

References

PVM documentation

See Also

.PVM.mytid

Examples

## Not run: 
children <- .PVM.spawnR (slave = "helloR.R")

## End(Not run)

[Package rpvm version 1.0-4 Index]