Muting 'starting worker' message from foreach in ROUT file

Viewed 41

My code currently looks like this

results= foreach(i=seq(1,n),.combine='c') %dopar% {
               require('Matrix',quietly=TRUE)
               start_time=Sys.time()
               Q[i]=some_function(1,2,3)
               end_time=Sys.time()
               print(end_time-start_time)
   }

where I am calculating something in parallel and want to be able to print to the ROUT file inside each parallel process. The problem is my ROUT file is filled with the following

starting worker pid=82688 on localhost:11668 at 10:57:10.347
starting worker pid=82672 on localhost:11668 at 10:57:10.347
starting worker pid=82677 on localhost:11668 at 10:57:10.347
starting worker pid=82680 on localhost:11668 at 10:57:10.347
starting worker pid=82669 on localhost:11668 at 10:57:10.346

Since my code involves me calling foreach multiple times this makes it very difficult to parse through the ROUT file

Is there a way to mute the "starting worker pid=..." lines from an R outfile in the foreach package?

0 Answers
Related