I have a code to generate a table with a computationally very expensive function f[x,y]
. I run the code on a cloud server, that is, from the command line without graphical output. I found a way to print to the terminal the parameters x
and y
before a cell is computed. However, unfortunately, I now see that my code got stuck computing one of many cells and just by knowing which cells were started I don't know which of those have actually finished successfully (and, in particular, which ones have not).
Here is my code so far:
tab = Block[{counter},
SetSharedVariable[counter];
ParallelTable[
counter++;
Print[{counter, (arg[[1]]), 10^21 (arg[[2]])}];
{arg[[1]], arg[[2]], f[arg[[1]], arg[[2]]]}, {arg,
Tuples[{Range[0, 2, 0.1], Range[0, 4, 0.1]}]},
Method -> "FinestGrained"]];
I assume that there is no way for me to recover the already computed cells. But at least I want to be smarter next time and print some information once the cell finished computing. I am aware that I could add this command at the end of the function f
. But is there also a way to include this kind of progress indicator in the ParallelTable
body?