I have a notebook where I work with large datasets, where the data is stored as an A x B array of signals, where each signal is often 1000 samples long. In the past I would track the progress of various filters by having a 'counter' variable incrementing and using ProgressIndicator to monitor the progress.
With larger datasets I'm able to make huge improvements with ParallelTable, but as everyone knows using SetSharedVariable kills the computation speed, so I'm losing the ability to monitor the progress (some routines take 30 minutes or more to complete). Is there some other way to track the progress of ParallelTable aside from my method?
Below is a simple Table based example of my code:
Make a 100 x 100 array of 1000 sample length time signals.
counter = 0;
data = Table[ Sin[10 2 Pi t^2], {100}, {100}, {t, 0, 1, 0.001}];
Dynamic@ProgressIndicator[ Dynamic@counter, {1, 100*100}]
t0=AbsoluteTime[];
dataF = Table[ counter++;
BandpassFilter[ data[[i, j]], {10*2*Pi, 30*2*Pi}, SampleRate -> 1000], {i, 100}, {j, 100}];
AbsoluteTime[] - t0
The above code completes on my machine in about 8 seconds. Simply changing to ParallelTable reduces down to under 2 seconds. Utilizing the following code works, but it slows down considerably.
counter = 0;
SetSharedVariable@counter;
data = Table[ Sin[10 2 Pi t^2], {100}, {100}, {t, 0, 1, 0.001}];
Dynamic@ProgressIndicator[ Dynamic@counter, {1, 100*100}]
t0=AbsoluteTime[];
dataF = ParallelTable[ counter++;
BandpassFilter[ data[[i, j]], {10*2*Pi, 30*2*Pi}, SampleRate -> 1000], {i, 100}, {j, 100}];
AbsoluteTime[] - t0
$KernelID
, and$KernelCount
many counters. That way there's no shared variable and each kernel is independent to work freely, but you can track the progress. $\endgroup$