To take some comments and put them into an answer, the reason this happens is auto-compilation. It's been extensively discussed on the site, but basically Mathematica will try to compile any call into Table
that's large enough and with a simple enough function directly down to C before evaluating.
This means it's impervious to inspection by things like Monitor
since it's not happening in the main evaluator loop. Consider this:
gammaList = Table[gamma, {gamma, 1, 10^2, 1}];
bigList = RandomReal[{}, {2000, 1000}];
Monitor[
Table[
bigList + gamma,
{gamma, gammaList}],
Row[{ProgressIndicator[gamma, {gammaList[[1]], gammaList[[-1]]}], gamma},
" "]
];
My old, slow computer can watch that churn. Now let's try bumping up the number of elements in gammaList
and bumping down the bigList
size:
gammaList = Table[gamma, {gamma, 1, 10^3, 1}];
bigList = RandomReal[{}, {1000, 1000}];
Now I just see this:
ProgressIndicator[gamma,{1,1000}]\[ThinSpace]gamma
Since gamma
isn't in the main evaluator it can't be watched. A way around this is to use two calls into Table
:
gammaList = Table[gamma, {gamma, 1, 10^3, 1}];
bigList = RandomReal[{}, {1000, 1000}];
chunkSize = 251;
numChunks = Ceiling[Length[gammaList]/chunkSize];
Monitor[
Table[
Table[
bigList + gamma,
{gamma, gammaList[[(chunk - 1)*chunkSize + 1 ;; UpTo[chunkSize*chunk]]]}
],
{chunk, numChunks}
],
Row[{ProgressIndicator[chunk, {1, numChunks}], chunk}, " "]
];
My computer complains vociferously about being asked to evaluate that, but you can watch it go.
Table[{gamma}, {gamma, gammaList}]
got auto-compiled so it's not being evaluated on the main loop (that'd be brutally slow anyway--keep as much off the main loop as possible). This meansMonitor
can't monitor it since it's happening squarely at the C/SIMD level. Try cutting10^8
down to10^2
and replacing{gamma}
withRandomReal[{}, {1000, 1000}]; {gamma}
. That's still a compilable expression but slow enough that you can see the indicator churn. $\endgroup$250
I think but it's inSystemOptions
). If your call were non-compilable (say usingFactorInteger
), yes, you'd be able to follow it, but you wouldn't wantMonitor
to be updating too often so it'd make sense to run it on some smallerTable
with a coarser step-size (say by evaluating1000
list elements in a chunk). $\endgroup$