I can't monitor ParallelTable:
Monitor[ParallelTable[Pause[3]; i, {i, 1, 10}], i]
just displays i until it is finished.
Do you guys know of alternatives?
|
I can't monitor ParallelTable:
just displays Do you guys know of alternatives? |
||||
| show 10 more comments |
|
One way is to set a shared variable that would be assigned to an iterator variable, and monitor that:
This may make sense if the computation for each
where the intervals to pause are random, so that not all kernels finish computing at the same time. EDIT As mentioned by @Szabolcs in the comments,
Here is one way to find out:
which returns |
|||||||||||||||
|
|
Modifying some ideas suggested here, and a suggestions from Leonid in the comments:
Basically, each kernel keeps a working tally of the number of elements it's solved, which dumps to a shared counter once it crosses an adjustable threshold. For example:
Also, this should work for nested
A quick check on Edit Not entirely sure why, but the counter that is monitored goes from 1 to (Maximum Iterations)/(number of kernels) rather than from 1 to (Maximum iterations) |
|||||||||||||
|
|
This is my final code for implementing a long calculation (demonstrated here over a plane of values) to ensure that all processors are being used and code to monitor the progress, with estimates of time remaining. The last line exports the data to a location specified in that line, so that you can easily come back to it and use it later.
|
|||||
|
ParallelTablemight send values to process to subkernels in batches (depending on theMethodsetting), so the table iterator variable does not get values sequentially as in the case ofTable. – Szabolcs Feb 9 '12 at 16:34Monitor[ParallelTable[expr, {i, 1, 10}], i]just displaysiuntil it's finished – acl Feb 9 '12 at 16:36ParallelTablepossibly sending batches of expressions to each kernel explains this (as I don't understand) rather than clarifying his answer... – acl Feb 9 '12 at 16:39