-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Futures: output and conditions are now relayed, but with glitch #59
Comments
Thanks @HenrikBengtsson for the outline, this is pretty cool. The progress bar is written to the main process's STDOUT (which is buffered, that's why we need to flush). Thus collecting output from the future processes makes a lot of sense, otherwise it can be quite hard to troubleshoot. I'll add the silencer as a quick fix and play around with the other option. |
This looks like a more general issue, not just with future. Future prints the warning (STDERR), however, |
It looks like that To make the two options (future and |
Signed-off-by: Peter Solymos <[email protected]>
Signed-off-by: Peter Solymos <[email protected]>
Actually not. See mclapply example in https://henrikbengtsson.github.io/future-tutorial-user2022/appendix.html#appendix-standard-output-by-other-parallel-map-reduce-apis |
Hmm. This is an eye opening read. Basically, if you want consistency, the "recommended" tools (what is in parallel) are the worst choice. |
With the support for futures, you now get automatic support for relaying of the standard output, messages, warnings, and other conditions, e.g. with
we get:
However, it looks like your progress bar is not prepared for having output generated in between the 0% step and the completion, e.g.
The quick fix to avoid this, is to disable relaying of stdout and conditions in futures, e.g.
That is how all other parallel frameworks work, i.e. they silently swallow any output.
Now, to actually relaying them, which is more useful, you have to buffer standard output and all conditions in:
pbapply/R/pblapply.R
Lines 73 to 76 in 53aa541
I'm thinking something like:
and then use:
PS. I've got future.mapreduce on the roadmap. One goal is to provide an API for others to build on and to avoid having to do manually do the above.
The text was updated successfully, but these errors were encountered: