MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

ProgressIndicator in ParallelTable problem, redux

  • To: mathgroup at
  • Subject: [mg131766] ProgressIndicator in ParallelTable problem, redux
  • From: psycho_dad <s.nesseris at>
  • Date: Tue, 1 Oct 2013 06:20:41 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

Hi all,

I have the following problem with ProgressIndicator and ParallelTable. Assume we have a function f (see below for a simple toy model) that performs a "long" calculation and carries its own ProgressIndicator to show how far it has progressed. It works OK if I run it once or in a Table (it runs serially of course), but if I run it inside a ParallelTable with N Kernels, the N progress bars remain "dead", while the calculation goes on OK.

To be more clear, what I want is to run the function f[] in Parallel with N Kernels, with each instance having its own progress bar updating dynamically. So, there should be N progress bars updating dynamically as the calculations go on.

In my real code f[] is too complicated but roughly it does a MCMC (plus some other stuff), so each instance would correspond to a different chain.

The toy model f[] is shown below and it just sums numbers k^2 from 0 to "end" (+ a time-delay):

f[end_] := DynamicModule[{n},(
   n = 0;

For example, the following gives the result along with a dynamic progress bar:


... while this runs f[10] 5 times serially (in the real case this would produce 5 different MCMC chains):


Now the parallel case:


If you run the last part you will notice that while it returns the expected result (roughly 5 times as fast), the progress bars don't update as they should. Any idea how to fix this?

This is not an issue of sharing the variables between Kernels with SetSharedVariable, like in!msg/comp.soft-sys.math.mathematica/L7LFEUIgVPo/nr3LQIZ2lloJ
as obviously each instance should have its own version. BTW, the latter is a slightly related question I had asked some time ago, hence the redux in the title.

Thanks for any help in advance!

  • Next by Date: Output display by slide
  • Next by thread: Re: ProgressIndicator in ParallelTable problem, redux