Displaying Parallel Progress Bars

Back when Juno was still maintained, I wrote a simple package for following progress of Distributed workers, which could be displayed inside Juno plot pane. In combination with TerminalLoggers it can show a basic display of textual progress bars.
https://github.com/yha/ObservablePmap.jl
Unfortunately, it doesn’t work in vscode plot pane, but it can work inside a Blink window, like this:

using Distributed
using Blink: Window, body!
addprocs(...)

@everywhere using ObservablePmap
@everywhere using ProgressLogging
@everywhere using TerminalLoggers

summ, task = ologpmap( 'a':'e', 2:2:10; logger_f=TerminalLogger ) do c, x
    @withprogress name="Processing '$c'" for i=1:x
        sleep(rand())
        @logprogress i/x
    end
    @info "finished '$c'."
    x
end

html = map(x -> HTML("<pre>$x</pre>"), summ)

w = Window()
body!(w, html)

The downside is that you need a dedicated window for showing the progress. Also, on my Windows machine that <pre> tag doesn’t seem to respected in the Blink window for some reason - it uses a non-monospace font, so the progress bars don’t quite look right.

1 Like