It’s going to be very hard for anyone to help you solving this, since we can’t access your system and replicate what happens.
A suggestion could be: convert the notebook to a python file (there is a option to do that in the “File” menu), and then run the resulting python file in your docker container several times. If one of the runs fails, hopefully it will give a traceback that may help understanding what is going on.
OK, what happens if you run that code (possibly, several times) in your docker container? Is there at least a run which crashes? If so, with which error?
I think you are running out of memory, as you are trying to do a 10 000 * 10 000 degrees of freedom problem on a single process (that is 100 000 000 dofs), which is way beyond what you should use with a linear solver.
I did some experiment on this. I set n_num=2000 and it crashed at the end. But the following is the data I collected with the command
docker status
It seems that when BLOCK I/O are buffering tons of data and it crashes, CPU are burning at the moment.
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 178.25% 3.307GiB / 3.831GiB 86.32% 647kB / 1.34MB 7.51GB / 1.05GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 57.05% 3.311GiB / 3.831GiB 86.41% 647kB / 1.34MB 10.5GB / 1.05GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.02% 2.787GiB / 3.831GiB 72.75% 566kB / 1.23MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.11% 2.787GiB / 3.831GiB 72.75% 566kB / 1.23MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.01% 2.787GiB / 3.831GiB 72.75% 566kB / 1.23MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.02% 2.787GiB / 3.831GiB 72.75% 566kB / 1.23MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.01% 2.787GiB / 3.831GiB 72.75% 566kB / 1.23MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.01% 2.788GiB / 3.831GiB 72.78% 587kB / 1.26MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.01% 2.788GiB / 3.831GiB 72.78% 593kB / 1.28MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.57% 2.789GiB / 3.831GiB 72.78% 597kB / 1.28MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.11% 2.788GiB / 3.831GiB 72.78% 597kB / 1.28MB 136MB / 0B 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 93.63% 3.095GiB / 3.831GiB 80.77% 602kB / 1.29MB 139MB / 441MB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 101.38% 3.163GiB / 3.831GiB 82.55% 606kB / 1.29MB 146MB / 692MB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 99.75% 3.112GiB / 3.831GiB 81.22% 608kB / 1.29MB 149MB / 905MB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.21% 3.275GiB / 3.831GiB 85.49% 610kB / 1.3MB 155MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.24% 3.274GiB / 3.831GiB 85.45% 613kB / 1.3MB 163MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.28% 3.274GiB / 3.831GiB 85.45% 613kB / 1.3MB 167MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 99.79% 3.274GiB / 3.831GiB 85.47% 615kB / 1.31MB 176MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.14% 3.278GiB / 3.831GiB 85.55% 619kB / 1.31MB 187MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.73% 3.28GiB / 3.831GiB 85.62% 620kB / 1.31MB 194MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.64% 3.281GiB / 3.831GiB 85.62% 624kB / 1.32MB 205MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 99.94% 3.274GiB / 3.831GiB 85.45% 624kB / 1.32MB 210MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 99.70% 3.274GiB / 3.831GiB 85.45% 625kB / 1.32MB 217MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.79% 3.278GiB / 3.831GiB 85.55% 629kB / 1.32MB 230MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 99.56% 3.274GiB / 3.831GiB 85.46% 629kB / 1.32MB 234MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 99.87% 3.274GiB / 3.831GiB 85.45% 631kB / 1.33MB 241MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 99.39% 3.274GiB / 3.831GiB 85.45% 634kB / 1.33MB 249MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.50% 3.278GiB / 3.831GiB 85.56% 634kB / 1.33MB 257MB / 1.03GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 100.49% 3.265GiB / 3.831GiB 85.21% 636kB / 1.33MB 267MB / 1.04GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 99.94% 3.264GiB / 3.831GiB 85.20% 639kB / 1.34MB 274MB / 1.04GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 178.25% 3.307GiB / 3.831GiB 86.32% 647kB / 1.34MB 7.51GB / 1.05GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 57.05% 3.311GiB / 3.831GiB 86.41% 647kB / 1.34MB 10.5GB / 1.05GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 54.03% 3.311GiB / 3.831GiB 86.43% 648kB / 1.35MB 13.7GB / 1.05GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 45.77% 3.32GiB / 3.831GiB 86.64% 649kB / 1.35MB 15.3GB / 1.05GB 22
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 4.58% 73.6MiB / 3.831GiB 1.88% 661kB / 1.36MB 16.5GB / 1.06GB 9
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 8.64% 135MiB / 3.831GiB 3.44% 669kB / 1.38MB 16.5GB / 1.06GB 20
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.01% 135MiB / 3.831GiB 3.44% 669kB / 1.38MB 16.5GB / 1.06GB 20
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.53% 135MiB / 3.831GiB 3.44% 674kB / 1.39MB 16.5GB / 1.06GB 20
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.02% 135MiB / 3.831GiB 3.44% 674kB / 1.39MB 16.5GB / 1.06GB 20
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.08% 135MiB / 3.831GiB 3.44% 676kB / 1.39MB 16.5GB / 1.06GB 20
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7eac5cc886e0 notebook 0.01% 135MiB / 3.831GiB 3.44% 682kB / 1.4MB 16.5GB / 1.06GB 20
You have a very limited amount of available RAM on your system.
You are trying to solve a problem with 4 million dofs with a linear solver. This is both going to be slow and memory consuming to do.
The speed, and some memory improvements can be gained by running in parallel with mpi,
But 4 GB ram is very little these days.