![]() |
|
|
#1 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
2·53·71 Posts |
Since forever I've used "kill -stop <pid>" and "kill -cont <pid>" to pause mprime, run a benchmark, and resume mprime.
However, I've started using the screen command to launch mprime and now the stop command (sometimes) stops mprime as if one typed ^Z from the screen. The continue command has no effect. Instead I must do "screen -r" and "fg". Am I doing something wrong? Is there a new preferred way to stop and resume processes? Last fiddled with by Prime95 on 2018-04-23 at 21:33 |
|
|
|
|
|
#2 |
|
"Mike"
Aug 2002
25×257 Posts |
To stop it, you could go to the screen that mprime is on and type CTRL+C, right?
Or are you trying to do it without reattaching your screen? |
|
|
|
|
|
#3 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
1D6616 Posts |
Yes.
I actually first noticed the problem when I was not using screen. I had booted the computer and started mprime at the main terminal. When I accessed the PC using ssh, "kill -stop" did the equivalent of a ^Z forcing me to physically visit the main terminal again. What I'm looking for is a universal way to pause/resume. When I use the shared Knight's Landing machine (or some other shared machine) I do not want to accidentally step on someone's toes. Last fiddled with by Prime95 on 2018-04-23 at 22:54 |
|
|
|
|
|
#4 | |
|
If I May
"Chris Halsall"
Sep 2002
Barbados
37×263 Posts |
Quote:
Are you absolutely certain you've got the PID correct? If you're only running one instance of mprime, you might consider using the "killall" command. This would be safe in a multi-user situation so long as the command isn't run as root. |
|
|
|
|
|
|
#5 |
|
"Mike"
Aug 2002
202016 Posts |
A weird (?) workaround would be to create a hook in mprime to look for a special file in the working directory. If the file exists, pause. Check at X second intervals. If file is removed, resume.
Sort of like "PauseWhileRunning". This would be super easy to implement and might even be useful for other needs. |
|
|
|
|
|
#6 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
2·53·71 Posts |
The pid is correct, the problem is repeatable, "kill -stop" equals ^Z, "kill -cont" is the equals a no-op. All results verified by watching the CPU time as returned by "ps ax | grep mprime".
|
|
|
|
|
|
#7 |
|
If I May
"Chris Halsall"
Sep 2002
Barbados
37·263 Posts |
|
|
|
|
|
|
#8 |
|
"/X\(‘-‘)/X\"
Jan 2013
22·733 Posts |
I run mprime in screen, and when I run `kill -stop PID` and then `kill -cont PID` it works as expected. This is under Ubuntu 16.04, and running as the same user.
|
|
|
|
|
|
#9 |
|
Jan 2015
11·23 Posts |
dunno if this is helpful but I run './mprime &" then 'disown' and log out. if i need to restart it i just kill the process and relaunch it. I'm a linux amateur though so i dunno if there's a better way to do it.
Last fiddled with by aurashift on 2018-06-18 at 18:07 |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Resume linear algebra | Timic | Msieve | 35 | 2020-10-05 23:08 |
| Resume dependency processing? | sean | YAFU | 7 | 2017-10-14 02:30 |
| Question about save & resume | frmky | GMP-ECM | 7 | 2012-08-02 08:22 |
| Question about resume | Phinne | Operation Billion Digits | 2 | 2009-04-25 10:00 |
| To code a "pause and save" function in GMP | initial | Programming | 3 | 2007-09-26 21:34 |