Re: [R] more efficient way to parallel

2012-08-06 Thread Martin Morgan
On 08/06/2012 09:41 AM, Jie wrote: After searching online, I found that clusterCall or foreach might be the solution. Re-write your outer loop as an lapply, then on non-Windows use parallel::mclapply. Or on windows use makePSOCKcluster and parLapply. I ended with library(parallel) library(M

Re: [R] more efficient way to parallel

2012-08-06 Thread John Kerpel
Not that I've had a chance to really look at the problem, but I've removed outer loops using parLapply from the parallel package. Works great. On Mon, Aug 6, 2012 at 11:41 AM, Jie wrote: > After searching online, I found that clusterCall or foreach might be the > solution. > > Best wishes, > Ji

Re: [R] more efficient way to parallel

2012-08-06 Thread Jie
After searching online, I found that clusterCall or foreach might be the solution. Best wishes, Jie On Sun, Aug 5, 2012 at 10:23 PM, Jie wrote: > Dear All, > > Suppose I have a program as below: Outside is a loop for simulation (with > random generated data), inside there are several sapply()'s

[R] more efficient way to parallel

2012-08-05 Thread Jie
Dear All, Suppose I have a program as below: Outside is a loop for simulation (with random generated data), inside there are several sapply()'s (10~100) over the data and something else, but these sapply's have to be sequential. And each sapply do not involve very intensive calculation (a few seco