Hello everyone,
I have general question about parallel programming. I'm doing simulations
that involves bootstrap. For now I'm using parLapply only for bootstrap
part and then function "replicate" for simulations. It is very long
function, so here is a short version:
simfun=function(data,n,alpha
Inline below.
On Fri, Sep 21, 2012 at 9:05 AM, R. Michael Weylandt
wrote:
> On Fri, Sep 21, 2012 at 5:43 AM, Tjun Kiat Teo wrote:
>> I am trying to do parallel programming and I tried this
>>
>> library(doSNOW)
>> library(foreach)
>>
>> testfunc<-function(x){
>> x<-x+1
>> x
>> }
>>
>> noc<-2
>>
On Fri, Sep 21, 2012 at 5:43 AM, Tjun Kiat Teo wrote:
> I am trying to do parallel programming and I tried this
>
> library(doSNOW)
> library(foreach)
>
> testfunc<-function(x){
> x<-x+1
> x
> }
>
> noc<-2
>
> cl <- makeCluster(do.call(rbind,rep(list("localhost"),noc)), type = "SOCK")
> registerDo
Then don't do that.
Use your script file to define functions. Source that file before the loop to
load them into memory. Call those functions from within your loop.
---
Jeff NewmillerThe .
I am trying to do parallel programming and I tried this
library(doSNOW)
library(foreach)
testfunc<-function(x){
x<-x+1
x
}
noc<-2
cl <- makeCluster(do.call(rbind,rep(list("localhost"),noc)), type = "SOCK")
registerDoSNOW(cl)
clusterExport(cl=cl,c("testfunc.r"))
testl<-foreach(pp=1:2) %dopar%
5 matches
Mail list logo