Looks like this requires use of foreach and lots of extra coding. R/parallel only requires that the loop be bracketed with the code to start the parallel processing-about 4-5 lines. Seems a lot easier to me. If I were to go to the trouble of writing a lot of new code, it seems that recompiling with BLAS and pnmath would be a better option.  My main question is how to handle the random number generation when the child processes are spawned. That's a problem no matter what method I choose to create the threads.  From: Tal Galili <tal.gal...@gmail.com> To: Scott Raynaud <scott.rayn...@yahoo.com> Cc: "r-help@r-project.org" <r-help@r-project.org> Sent: Thursday, December 8, 2011 12:38 PM Subject: Re: [R] R/parallel
Hi Scott, Why not use the doSMP package from REvolution? http://www.r-statistics.com/2010/04/parallel-multicore-processing-with-r-on-windows/ Tal ----------------Contact Details:------------------------------------------------------- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- te: I want to take advantage of my multicore CPU to speed up a loop in a simulation program. I didnât write the code, >but the iterations appear independent to me, at least in the sense that the >results of one loop do not depend on >previous ones. Right now Iâm relegated to a Windows box that runs Windows >7. These appear to be the options: > >Pnmath-appears to parallelize non-BLAS routine but requires a special build >Fork-UNIX only >Romp-looks like this hasnât advanced past the developmental stage >Multicore-use on Windows at your own risk >R/parallel-seems like the best option if I donât want to recompile. > >Has anyone ever used R/parallel? What kind of results did you have? One >difficulty with my simulation is that the >loop includes code to generate random numbers. If this loop is split into >different threads, then I suspect the >randomness of the numbers is not assured. What can I do about that? > >I can provide the loop code, but itâs fairly long, say 75-100 lines. > >If R/parallel is not feasible then a recompile with BLAS and pnmath appears to >be the next best option. > [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.