Re: [sage-support] Obtaining data from a computation in process
On Mon, Sep 13, 2010 at 12:41 PM, Alastair Irving wrote: > It depends on precisely what form your code takes. If you're running the > loop at the top level with S as a global variable then you should be able to > do ctrl-c to terminate the computation and then look at S or any other > global variable. If your computations happening inside a function call then > I don't know of any way round it. If your set S is occurring in a (Python) function call and you are at the Sage command-line, then you can do Ctrl-C to stop the computation, type in "%debug" to enter the debugger, enter "u" until you move up the call stack until you are at the place where your S is defined. Then, you can do "print S" to have it print the set. There may be trickier ways of manipulating the stack frame, but I don't know offhand what they are. --Mike -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
Re: [sage-support] Obtaining data from a computation in process
On 13/09/2010 20:01, Nick wrote: Hello! I have a computation running in Sage. It is a search of more or less the following form: Let S be an empty set. For i in some interval: Check some property for i If i satisfies the property: add i to the set S. I now realise I should have said "print i" rather than "add i to the set S". Originally I thought it was a good idea because it was easy to manipulate the output once the search had been completed if it was in a set. However, now that the search has yet to conclude after a week or so I wonder if there is a simple way to check what is currently in S? Is there any way to obtain the set S while the process continues to run? I'd even be interested to learn if there is a way to terminate the process and check what values of i have gathered in S up until termination. Any ideas? Or is it a lose cause? Hi It depends on precisely what form your code takes. If you're running the loop at the top level with S as a global variable then you should be able to do ctrl-c to terminate the computation and then look at S or any other global variable. If your computations happening inside a function call then I don't know of any way round it. HTH Alastair Thanks very much. -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Obtaining data from a computation in process
Hello! I have a computation running in Sage. It is a search of more or less the following form: Let S be an empty set. For i in some interval: Check some property for i If i satisfies the property: add i to the set S. I now realise I should have said "print i" rather than "add i to the set S". Originally I thought it was a good idea because it was easy to manipulate the output once the search had been completed if it was in a set. However, now that the search has yet to conclude after a week or so I wonder if there is a simple way to check what is currently in S? Is there any way to obtain the set S while the process continues to run? I'd even be interested to learn if there is a way to terminate the process and check what values of i have gathered in S up until termination. Any ideas? Or is it a lose cause? Thanks very much. -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org