2021-07-06 15:02:23 +0200 | received badge | ● Famous Question (source) |
2016-06-21 18:56:42 +0200 | received badge | ● Notable Question (source) |
2015-11-06 10:39:50 +0200 | received badge | ● Popular Question (source) |
2011-07-13 22:51:34 +0200 | commented answer | How can I add a timeout to a charpoly calculation? that's true :) |
2011-07-13 06:13:27 +0200 | received badge | ● Teacher (source) |
2011-07-13 06:13:27 +0200 | received badge | ● Self-Learner (source) |
2011-07-13 04:53:02 +0200 | received badge | ● Editor (source) |
2011-07-13 04:50:08 +0200 | answered a question | How can I add a timeout to a charpoly calculation? OK here's my horrible workaround using rob hooft's task.py: Write my matrix to a text-file. Put the charpoly calculation in a separate file called charpoly.sage which reads in the matrix from that text-file, and outputs its result to another text-file. Then in the main code run the following: That last rubbish is because sage spawns some other python processes which eat up all the cpu and are not killed by task.Kill(). It's not pretty but it'll do the trick for now. The reason that I simply restart the calculation after a timeout is that it only sporadically gets stuck, and restarting seems to get it going again, go figure... |
2011-07-12 12:09:14 +0200 | commented answer | How can I add a timeout to a charpoly calculation? thanks for the suggestions, i can't get any of them to work though... for some reason charpoly ignores KeyboardException, SystemExit and so on, in fact sometimes when you do ctrl-c to stop it, you get a seg-fault... so maybe there's no easy answer? |
2011-07-12 09:19:50 +0200 | received badge | ● Student (source) |
2011-07-12 00:06:42 +0200 | asked a question | How can I add a timeout to a charpoly calculation? For some reason after a bunch of matrix charpoly calculations, charpoly hangs on me. I suppose it's some memory problem, but rather that fix that, I just want to put a timeout on the calculation and then restart it if it hangs. The problem is I can't use the "alarm" solution given in the answer to this question because sage.matrix.matrix_integer_dense.Matrix_integer_dense.charpoly doesn't catch the KeyboardInterrupt: What is another approach I could use? |