Message-ID: <BANLkTim7f5WMp9AVnBFDEYNaMdoqdf5dFA@mail.gmail.com>
Date: 2011-04-11T17:09:59Z
From: Steve Lianoglou
Subject: Comparing execution times
In-Reply-To: <706347.40858.qm@web120109.mail.ne1.yahoo.com>
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