Re: [R] Comparing execution times

From: Steve Lianoglou <mailinglist.honeypot_at_gmail.com>
Date: Mon, 11 Apr 2011 13:09:59 -0400

Just a comment about your use of foreach:

On Mon, Apr 11, 2011 at 6:29 AM, Alaios <alaios_at_yahoo.com> wrote: [snip]
> C.Case. Foreach is considered to be easier to be applied to manycores.
>
> foreach (i=1:dimz) %do% {
>    print(sprintf('Creating the %d map',i));
>    Shadowlist[,,i]<-f <- GaussRF(x=x, y=y, model=model, grid=TRUE,param=c(mean,variance,nugget,scale,Whit.alpha))
>
> }

You are still running this sequentially.

To run in parallel, you need load the appropriate parallel backend, and use %dopar%:

library(doMC)
foreach(i=1:dimz) %dopar% { ... }

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

______________________________________________
R-help_at_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.
Received on Mon 11 Apr 2011 - 17:17:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 11 Apr 2011 - 17:20:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive