# Displaying Parallel Progress Bars

**URL:** <https://discourse.julialang.org/t/displaying-parallel-progress-bars/4148>\
**Category:** General Usage\
**Created:** [June 7, 2017, 8:47pm UTC](https://discourse.julialang.org/t/displaying-parallel-progress-bars/4148 "2017-06-07T20:47:36Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![adamslc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamslc/32/3452_2.png) [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Post date:** [June 21, 2017, 6:45pm UTC](https://discourse.julialang.org/t/displaying-parallel-progress-bars/4148/5 "2017-06-21T18:45:24Z")

</div>

In case this helps anyone else, I’ve hacked together a working version of this functionality using [ProgressMeter.jl](https://github.com/timholy/ProgressMeter.jl) as a base. I’ve been using it for a while now, and it seems to work well enough. If anyone has suggestions, I would be happy to incorporate them. You can find the package here:

[https://github.com/adamslc/ProgressMeter.jl](https://github.com/adamslc/ProgressMeter.jl)

To use it, add some worker processes and define a work function:

```julia
addprocs(4)

@everywhere using ProgressMeter

@everywhere function test_function(x, p=nothing)
    @info("Running with value $x")

    @parallelprogress p "optional label " for i in 1:x
        sleep(0.1)
    end

    @info("Done")
    return x
end

```

Then it can either be run directly on the master process, or farmed out to the worker processes:

```julia
julia> test_function(100)
INFO: Running with value 100
optional label 100%|████████████████████████████████████| Time: 0:00:10
INFO: Done
100

julia> ProgressMeter.pmap(test_function, [50, 50, 100, 25, 10, 50])
2 tasks remaining to start
-------------------------------
optional label 40%|██████████████ | ETA: 0:00:04
optional label 80%|█████████████████████████████ | ETA: 0:00:01
optional label 40%|██████████████ | ETA: 0:00:04
optional label 20%|███████ | ETA: 0:00:10

```

The `@info` macros allow you to print diagnostic information while you are still developing, and then easily run the function in parallel once everything is working.

---

_[View the full topic](https://discourse.julialang.org/t/displaying-parallel-progress-bars/4148)._
