Ask Your Question

Difference between Running and Open but not running

asked 2012-02-24 02:45:54 -0500

G-Sage gravatar image

I often run long calculations. I start them going and close the tab where it's running. If it's going to run for a day, there's no reason to have the clutter of the tab there all day, especially since if I click on it, I might mess up the calculation some how.

When I see the list of my notebooks, I see (running) if it is still actually running AND also if it has finished running and the program is simply open but not doing anything. So, I have to open it every once in a while to see if it's finished. Is there some way to figure out the difference?

edit retag flag offensive close merge delete


Probably not in the notebook. This is possible for command-line processes. If you are doing a lot of long calculations, that may be a better way to handle it in any case, since you get a lot more flexibility if you are a command-line ninja. Which I am not. Anyway, hopefully some will give answers of some of the mechanisms for doing so.

kcrisman gravatar imagekcrisman ( 2012-02-24 03:45:20 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2012-02-24 06:05:49 -0500

I agree with kcrisman: I wouldn't use the notebook for this. Instead, from the command line, you should use "screen", as in

$ screen sage

Then you do what you want in Sage, and when you want to hide it, you "detach" the screen (I think the default command for that is "ctrl-A d"). Later on, you can reattach the screen using

$ screen -r

from the command line.

For example, when I'm building Sage on some remote machine, I log in, type screen make ptestlong, detach the screen, and then log out. While it's still building, I can reattach the screen to see what's going on (or I can just look at $SAGE_ROOT/spkg/logs). When the build process finishes, the screen goes away automatically. If I were doing some long computation in Sage, I might set it up to write output to some file so that I can just look at the file instead of reattaching the screen.

Alternatively, I could just run screen with no arguments. This starts a new shell in which I could execute commands, like make ptestlong or sage. This screen won't go away until I exit from the shell.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-02-24 02:45:54 -0500

Seen: 117 times

Last updated: Feb 24 '12