startBardCluster {BARD}R Documentation

Use bard with snow distributed computing clusters.

Description

These functions configure a snow computing cluster to be used with bard profiling, sampling, and plan refinement

Usage

  startBardCluster(cl)
  stopBardCluster()

Arguments

cl either a cluster returned from snow or a vector of cluster systems names

Details

This function attempts to configure a computing cluster for bard. If given an existing snow cluster, it will use that. If given a vector of machine names it will use makeCluster to start a socket-based cluster. (You will be required to enter your login password for these systems, if you have not set up an existing ssh key.)

Plan sampling and profiling, and some plan refinement will automatically use a cluster that has been initialized.

stopBardCluster stops and disbands the cluster configured through startBardCluster. It is normally called automatically when the BARD module is unloaded.

Value

Returns a logical value indicating successful initialization.

Note

Initialization will fail if attempts to connect to the machines fail, or if BARD cannot be installed and started on these systems (an attempt to install BARD will automatically be made, if BARD is not installed.)

Author(s)

Micah Altman Micah_Altman@harvard.edu http://www.hmdc.harvard.edu/micah_altman/

See Also

Plan refinement algorithms refineGenoudPlan

Plan sampling: samplePlans, profilePlans

Cluster computing: makeCluster

Examples

  ## Not run: 
        suffolk.map <- importBardShape(file.path(system.file("shapefiles", package="BARD"),"suffolk_tracts"))  
          numberdists <- 5
  kplan <- createKmeansPlan(suffolk.map,numberdists)
  rplan <- createRandomPlan(suffolk.map,numberdists)
  myScore<-function(plan,...)  {
    return(calcContiguityScore(plan,...))
  }         

# here is where we try to start the cluster!
        startBardCluster(c("localhost","localhost")) 

# this will use the cluster automagically
samples<-samplePlans(kplan, score.fun=myScore, ngenplans=4, gen.fun = "createRandomPlan", refine.fun="refineNelderPlan",refine.args=list(maxit=200,dynamicscoring=TRUE))

profplans<-profilePlans(  list(kplan,rplan), score.fun=calcContiguityScore, addscore.fun=calcPopScore, numevals=2, weight=c(0,.5,1), refine.fun="refineNelderPlan",refine.args=list(maxit=200,dynamicscoring=TRUE) )

## End(Not run)


[Package BARD version 1.03 Index]