While playing with graphs.nauty_geng(...), I noticed that the geng 
subprocess might remain active after a ctrl-C, and even after existing the 
current sagemath session. This is not always the case, but it happens 
frequently.

Try this for instance (I'm using debug mode to quickly get an output):
sage: next(graphs.nauty_geng("-c 30", debug=True))
'>A geng -cd1D29 n=30 e=29-435\n'
sage:
then check your active processes, quit the sage session and continue 
checking for active processes.

Then I tried to handle keyboard interrupt in nauty_geng adding
            except KeyboardInterrupt:
                sp.kill()
                raise KeyboardInterrupt()

and used the following example:
sage: for g in graphs.nauty_geng("-c 30", debug=True):
....:     print(g)
....:
>A geng -cd1D29 n=30 e=29-435

^C
again, most of the time the geng process remains active after ctrl-C even 
if I quit the sage session. I also tried sp.terminate() with the same 
result.

At least, using this code the geng process is always killed after ctrl-C
            except KeyboardInterrupt:
                while sp.poll() is None:
                    sp.kill()
                raise KeyboardInterrupt()

However, I don't know how to force termination of the process after
sage: next(graphs.nauty_geng("-c 30", debug=True))


What can we do to fix that ?

David.









-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/6bd0e8c8-56bd-446b-89e0-10e8d0847f6d%40googlegroups.com.

Reply via email to