sleigh {nws}R Documentation

Class “sleigh"

Description

Class representing sleigh.

Objects from the Class

Objects can be created by calls of the form new("sleigh", ...), where `...' can be one or more of the following named arguments.

  • nodeList: a list of hosts that workers will be created. This argument is irrelevant when launch equals `local'. Default is to start up three workers on local machine.
  • workerCount: number of workers that will be created. This argument is only relevant when launch equals `local'. Default is three workers.
  • launch: method to launch remote workers. Default is `local'.
  • nwsHost: host name of the netWorkSpaces server. Default is the machine where sleigh starts up.
  • nwsPort: port number of the netWorkSpaces server. Default is 8765.
  • scriptExec: command to execute worker script. Default uses scriptcmd function on Windows, and uses envcmd function on other platforms.
  • scriptDir: location of the sleigh worker script. Default is the bin directory under where nws library is installed on the system. If library cannot be found, then use current working directory.
  • scriptName: worker script file name. Default is RNWSSleighWorker.py on Windows, and RNWSSleighWorker.sh on other platforms.
  • workingDir: worker's working directory. Default to master's current working directory.
  • logDir: location where log files will be stored. Default is NULL.
  • outfile: remote workers' standard errors will be redirected to this file. Default is NULL.
  • wsNameTemplate: template name to create sleigh workspace.
    Default is 'sleigh_ride_%010d'.
  • user: user name. Default is the value returned from Sys.info()$[$'user'$]$.
  • verbose: a boolean value indicating whether to print out debug messages. Default is FALSE.

    Slots

    nodeList:
    Object of class "character" representation of a list of host names where workers are created.
    nws:
    Object of class "netWorkSpace" representation of the sleigh workspace.
    nwsName:
    Object of class "character" representation of the sleigh workspace name.
    nwss:
    Object of class "nwsServer" representation of the netWorkSpaces server that this sleigh workspace connects to.
    state:
    Object of class "environment" representation of the sleigh state.

    Methods

    initialize
    signature(.Object = "sleigh"): sleigh class constructor.
    eachElem
    signature(.Object = "sleigh"): evaluate the given function with multiple argument sets using the workers in sleigh.
    eachWorker
    signature(.Object = "sleigh"): evaluate the given function exactly once for each worker in sleigh.
    stopSleigh
    signature(.Object = "sleigh"): shutdown workers and remove sleigh workspace.
    rankCount
    signature(.Object = "sleigh"): get sleigh's rankCount.
    workerCount
    signature(.Object = "sleigh"): get number of workers started in sleigh.

    Details

    There are five different launch types ('local', sshcmd, rshcmd, lsfcmd, and 'web') to tailor client's working environment. This is done by setting launch variable to a function (sshcmd, rshcmd, or lsfcmd) or a string ('local' and 'web'). see examples section.

    Examples

    ## Not run: 
    # Default option: create three sleigh workers on local host
    s <- sleigh()
    # Or, 
    s <- new('sleigh')
    # Or,
    s <- sleigh(launch='local')
    
    # Create sleigh workers on multiple machines using SSH
    s <- sleigh(c('n1', 'n2', 'n3'), launch=sshcmd)
    
    # Use LSF to remote login to remote machines. 
    s <- sleigh(launch=lsfcmd)
    
    # Use web launch
    s <- sleigh(launch='web')
    
    ## End(Not run)
    

    [Package nws version 1.4.0.1 Index]