ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 11 Oct 2019 09:27:37 +0200Sage stalls during computationhttps://ask.sagemath.org/question/48270/sage-stalls-during-computation/I was using SageMath 8.8's [feedback_edge_set](http://doc.sagemath.org/html/en/reference/graphs/sage/graphs/digraph.html#sage.graphs.digraph.DiGraph.feedback_edge_set) function on a large dataset. The calculation would take a couple of days to finish.
Unfortunately, Sage would keep stalling every few hours. The CPU usage of the process would simply drop to zero, and it would stop doing anything. I had to kill the process (a simple `kill` worked, no `kill -9` necessary).
Has anyone else experienced this? Is it a known problem? Is there a workaround? It is very frustrating to have to keep manually killing and restarting the process. This problem also prevents me from running a calculation overnight: in the morning I might find that it stopped merely an hour after I started it (if I'm unlucky).
----
More information:
- I was using Sage on Linux
- This function uses [MixedIntegerLinearProgram](http://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html#sage.numerical.mip.MixedIntegerLinearProgram). I used the default GLPK (didn't change settings)
- I used `alarm()` to set a time limit on each computation.
- I always believed GLPK [not to be interruptible](https://lists.gnu.org/archive/html/help-glpk/2006-04/msg00059.html), so I am not even sure which interruption (either manual or alarm) work on Sage with this function. This may be relevant.
- The memory usage of the process stayed low. It did not stall because the memory got filled and the machine started swapping.
----
Minimal example:
Put this in a source file:
import datetime
i=1
while True:
alarm(60)
try:
dg=digraphs.RandomDirectedGNM(300,750);
fes = dg.feedback_edge_set()
print(len(fes))
except AlarmInterrupt:
print("timeout")
cancel_alarm()
print(i)
print(str(datetime.datetime.now()))
print("\n")
i = i+1
Run it as `sage sourcefile.sage`.
In my last test, it took 291 iterations and ~4-5 hours before it stalled.
It appears to stall only when GLPK is used as the MIP solver (i.e. `feedback_edge_set(solver='GLPK')`, which is also the default). If I use `solver='Coin'` (which needs to be installed first using `sage -i cbc`) then it does not stall. However, the calculation is several times slower with Coin than with GLPK.SzabolcsFri, 11 Oct 2019 09:27:37 +0200https://ask.sagemath.org/question/48270/Process Sage illegal instruction: 4https://ask.sagemath.org/question/44135/process-sage-illegal-instruction-4/If this is a known bug, I've not been able to find a solution. Please advice.
I get this error:
Process Sage illegal instruction: 4
when I run this code:
from matplotlib import rc
g=Graph({1:[2,3], 2:[1,3], 3:[1,2]});
latex(g.plot(figsize=[2,2],vertex_size=450,layout='spring',color_by_label=True));
It used to run. This is not new code. The versions I'm running are:
Mac OS X El Capitan 10.11.6 (15G22010)
XCode Version 8.0 (8A218a)
SageMath version 8.3, Release Date: 2018-08-03
GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G22010))
ob-sagemath 0.4
sage-shell-mode 0.3ufoppThu, 01 Nov 2018 07:50:54 +0100https://ask.sagemath.org/question/44135/Resuming a running process in Sagehttps://ask.sagemath.org/question/8941/resuming-a-running-process-in-sage/Dear all,
I am running the Sage on Ubuntu and I am using the vertex_coloring() to calculate
the k-colorablity of a specific graph. As you might know the process is long enough
and the electricity may gone through the process. Is there any way that I could make
a sage process resumable or in way moderate the vertex_coloring() to resume the things
from the last point it left?
Thanks.NajiTue, 01 May 2012 06:21:10 +0200https://ask.sagemath.org/question/8941/