Skip to content

Commit 3fdcbcc

Browse files
committed
destroy per-chain progress bars if an error occurs
1 parent f5a6535 commit 3fdcbcc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/sample.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,6 @@ function mcmcsample(
454454
# Start the progress bars (but in reverse order, because
455455
# ProgressLogging prints from the bottom up, and we want chain 1 to
456456
# show up at the top)
457-
# TODO: This has an unintended effect that the 'time' field in the
458-
# progress bar shows the total time since the beginning of sampling,
459-
# even if the specific chain doesn't start sampling until later on.
460457
for (i, uuid) in enumerate(reverse(uuids))
461458
ProgressLogging.@logprogress name = "Chain $(nchains-i+1)/$nchains" nothing _id =
462459
uuid
@@ -536,8 +533,13 @@ function mcmcsample(
536533
end
537534
end
538535
finally
539-
# Stop updating the progress bar.
536+
# Stop updating the progress bars (either if sampling is done, or if
537+
# an error occurs).
540538
progress && put!(channel, false)
539+
for (i, uuid) in enumerate(reverse(uuids))
540+
ProgressLogging.@logprogress name = "Chain $(nchains-i+1)/$nchains" "done" _id =
541+
uuid
542+
end
541543
end
542544
end
543545
end

0 commit comments

Comments
 (0)