Closed D2Joy closed 11 months ago
Describe the bug I originally have the option
.verbose = T
and .option with progress bar usingdoSNOW
and tried to migrate todoFuture
. However, no matter usingregisterDoFuture()
or%dofuture%
methods, I only got the the log for the first loop and then nothing updated. It won't give the rest of the log until the very end of the parallel processing, and no progress bar at all.
This is expected and by design. It's not a bug and you're not doing anything wrong.
To better understand why, it's helpful to understand that the doSNOW package is unique in how it report on progress. AFAIK, no other do... package implement progress updates by themselves. One could argue that the doSNOW progress reporter is rather ad hoc and quite limited, e.g. it is not providing "real time" progress reporting - it only reports on progress as parallel workers complete their tasks.
One could also argue that the developers of foreach, who also developed legacy doSNOW, could have implemented such progress reporting directly in foreach(...) %dopar% ...
itself, but they choose not to. So, I take it that they were not satisfied with this solution and when they moved away from doSNOW to doParallel etc., they decided not to bring it in.
Now, to report on progress with the Futureverse, the recommend way is to use the progressr package. Contrary to doSNOW, it also has the capacity to report progress in a near-live fashion and with greater granularity.
See https://progressr.futureverse.org/#foreach-with-dofuture for an example how to use progressr with doFuture. That examples used %dopar%
(will update that in the next release), but it works the same with %dofuture%
.
PS. See if you can upgrade to a modern version of R; R 3.6.3 is quite old, and you're missing out on lots of great new features, including some affecting progress reporting, but also stability of parallel workers.
Hi, HenrikBengtsson. Thanks for the detailed explanation.
I see. I will need to use progressr package for progress then. How about .verbose = T
? The log is also not showing at runtime.
How about
.verbose = T
?
It's currently not supported by doFuture, but I can see how it could be useful, especially since all other doNNN packages support it to some degree. I've added #80 to the to-do list.
The log is also not showing at runtime.
I'm not sure if this is a separate question, or related to .verbose = TRUE
.
Thanks for the planning. That is the same issue I referred.
(Please use https://github.com/HenrikBengtsson/future/discussions for Q&A)
Describe the bug I originally have the option
.verbose = T
and .option with progress bar usingdoSNOW
and tried to migrate todoFuture
. However, no matter usingregisterDoFuture()
or%dofuture%
methods, I only got the the log for the first loop and then nothing updated. It won't give the rest of the log until the very end of the parallel processing, and no progress bar at all.Reproduce example I have code just like below:
progress <- function(n) setTxtProgressBar(txtProgressBar(max = length(filepaths_pos), style = 3), n)
merged_slice<-foreach (i = 1:length(filepaths_pos), .combine=rbind, .verbose = T, .options.snow= list(progress = progress))%dofuture%{...}
I also tried with.option.future
, and still got no progress bar.Expected behavior I expect the log and the progress bar to update at the real time, just like it behaves with
doSNOW
.Session information Please share your session information, e.g.