Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running an MPI program with SSH secure shell. Due to Wi-Fi disconnection, my la[top looses connection with server and causes failure of running process at server.

As per above suggested solutions, I tried to use "screen -dmSL" command with defining the "workstuff" named with another name and then the command (which is in the form - "./mpirun ......") that I have given to execute the process.

In terminal (in OpenSuse Linux environment) the process I have suspended with "Ctrl-z". It worked well. But when I restarted the SSH Shell after an hour to check either the process completed or not and entered the command "screen -x "...." (workstuff name). I got message as "There is no screen to be attached matching "..." (workstuff name).

I executed the process after entering to sub-folders. So I tried in that way too. But nothing happened.

Was I missed something while giving the command? Plz provide the solution.

I thank you in advance.

share|improve this question

3 Answers 3

up vote 0 down vote accepted

Do you need to see the screen output? If not, simply run the process with an ampersand (&) at the end like so:

./my_process&

If you do need the output, then in most cases you can pipe stdout to a file like this:

./my_process > output.txt&
share|improve this answer
    
Hi. The suggested solutions worked. The only thing I won't understand that while returning back to check the ongoing process, the same command should be given again or the server works just on previously defined condition i.e. "./my_process.... ". And further if I want just close the SSH shell not the process, then does it need any another command? –  Vishal Feb 10 at 19:23

Look at the -r/-R and -d/-D options on the man page for screen . Running screen -D -RR -x ... (workstuff) works for me when a detached screen is not letting me reattach.

share|improve this answer

Did you try nohup

nohup ./myprogram > foo.out 2> foo.err < /dev/null &

share|improve this answer
    
I am not sure about nohup. But I have checked the previous comments related to "nohup". At there the most sophisticated solution I found was "screen". So, do u mean the "nohup" will be a better option for particular my problem or it is a common solution for all similar questions? Also it is not clear from above solution that how could I come out of SSH shell (by any further command or just quitting the SSH) and how to return back to process. –  Vishal Feb 10 at 19:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.