Skip to content
Prev 1040 / 2152 Next

request help with replication and snowFT

Paul,
Make parallel computing in R as easy as possible.
You can just pack the additional functions into the main function. In 
your example,

## The main function of interest
myNorm<- function (x){
   myA<- function( x ){
     2 *x
   }
   myB<- function( x ){
     3 * x
   }
   myC<- function( x, y){
     x + y
   }
   whew<-  myA(x)
   whewyou<- myB(whew)
   whewwho<- myC(whew, whewyou)
   y<- rnorm(whewwho)
   list(x, whew, whewyou, whewwho, y, sum(y))
}


The Sys.info call can be defined in an init function:

nodeinfo<- function() Sys.info()[c("nodename","machine")]


Then, you can use performParallel:

res1<- performParallel(cnt, x=myx, fun=myNorm, initfun=nodeinfo, seed=mySeeds)
I can do that.

Note that snowFT is not an attempt to replace snow - it is its 
extension.  It simplifies its usage in order to make it accessible to 
people who might otherwise feel too intimidated by parallel computing 
(and offers some additional benefits such as reproducibility and fault 
tolerance). But for people who want to explore and dig into the details, 
the full set of snow functions is available.
There is no function that allows this. It would be a nice extension 
though - let me know if you have a suggestion for an implementation.

Hana