Hi useRs,
I am running a foreach loop and hoped to get a small message when it hits a multiple of 1000, but it does not work.
p <- foreach(i=1:10000, .combine='c') %dopar% {
if(i%%1000==0) print(i)
sqrt(i)
}
What is the proper way to do it.
Thanks everybody.
Stephen B
fedback from foreach
2 messages · Bond, Stephen, Ismail SEZEN
On 13 Jun 2017, at 23:05, Bond, Stephen <Stephen.Bond at cibc.com> wrote:
Hi useRs,
I am running a foreach loop and hoped to get a small message when it hits a multiple of 1000, but it does not work.
p <- foreach(i=1:10000, .combine='c') %dopar% {
if(i%%1000==0) print(i)
sqrt(i)
}
What is the proper way to do it.
Thanks everybody.
Stephen B
https://stackoverflow.com/questions/10903787/how-can-i-print-when-using-dopar <https://stackoverflow.com/questions/10903787/how-can-i-print-when-using-dopar> https://www.r-bloggers.com/monitoring-progress-inside-a-foreach-loop/ <https://www.r-bloggers.com/monitoring-progress-inside-a-foreach-loop/> https://github.com/berkeley-scf/tutorial-parallel-basics/issues/2 <https://github.com/berkeley-scf/tutorial-parallel-basics/issues/2> https://sumidiot.wordpress.com/2011/11/05/printing-in-foreachs-dopar/ <https://sumidiot.wordpress.com/2011/11/05/printing-in-foreachs-dopar/>