I run a Jupyter notebook. One cell contains a control loop of a CPU/memory intensive FEniCS computations. The loop uses print(i)
as a progress indicator (where i
is the iteration count). As there have been other notebooks running in parallel, swapping happened and the frontend of the notebook has been reloaded. That left me with:
- the kernel process running (I can see it in the
htop
output), - the kernel is busy (I requested to execute another cell and I am still waiting, the cell is marked
[*]
), - the
stdio
output of the cell is frozen as it has been somewhen before the reloading (37%), - the cell is marked as neither executed nor running (
[ ]
), - the notebook favicon is "busy" (a hourglass),
- the kernel ignoring (?) interrupt requests - it does not stop when I click the stop button (but I am used to such behaviour when I use FEniCS).
From experience I know, that either:
- the cell is actually running, the state is there, and I can access it will be accessible after the execution is finished,
- the cell has hanged (e.g. kernel is deadlocked performing some kind of busy waiting or so, IDK).
I have interrupted the kernel (with either Jupyter notebook frontend or kill -2
- I had tried both). The cell was actually running and the control loop was at 98% (no data lost though). But I still want to know whether there is any way I can get access to stdout
stream in cases like this (without interrupting the execution unless it can be resumed exactly where it was interrupted).