Thread-safety of ProgressMeter
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- julia
- Domain
- distributed-systems
Research direction
Start by reproducing the two examples with Progress, next!, @parallel, @spawn, and fetch to observe where progress updates are delayed or lost. Read the ProgressMeter implementation around Progress and next! and determine the supported behavior for updates from worker processes; done means progress is displayed during the parallel computation rather than only when it returns.
Written by the indexing model from the issue text.
Description
Hi Tim! Me again =)
Is there something special I need to do to use ProgressMeter for parallel computations? I tried something like
function long_running_function()
n = 100
p = Progress(n, 1)
@parallel for i in 1:n
sleep(0.1)
next!(p)
end
end
addprocs(3)
@everywhere using ProgressMeter
long_running_function()
but the call just returned and nothing was printed. I guess it's because p is only defined locally, but I haven't done enough parallel programming in Julia to see intuitively how to make it work on all processes. Adding some @spawn and @fetch calls has some, but not all of the desired, effect - it does print the progress line, but only at the very end, at the same time as the REPL prints the return value.
function long_running_function2()
n = 100
p = @spawn Progress(n, 1)
@parallel for i in 1:n
sleep(0.1)
next!(fetch(p))
end
end
- Dominant language
- Julia
- Stars
- 789
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from timholy/ProgressMeter.jl
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
timholy/ProgressMeter.jl#360 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
timholy/ProgressMeter.jl#362 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
timholy/ProgressMeter.jl#361 · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
timholy/ProgressMeter.jl#359 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
timholy/ProgressMeter.jl#357 · 4 comments ·
All issues in timholy/ProgressMeter.jl
Similar issues
-
tagbot-manual
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Sienna-Platform/PowerSystems.jl#1800 ·
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100