Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have started a program in parallel using the command:

    nohup mpirun -7 mylongprogram.py &

I now want to terminate the program. When I want to kill the process by the command:

    kill -9 <PID>

I see that another process with a different PID is started. How do I kill the entire mpi program and prevent nohup from doing this?

share|improve this question

migrated from stackoverflow.com Nov 4 '13 at 0:37

This question came from our site for professional and enthusiast programmers.

1  
Questions about usage of general Unix tools like nohup should be asked on the Super User site. –  Hristo Iliev Oct 21 '13 at 8:45

2 Answers 2

Instead of forcing the program to shut down from the outside, I'd try triggering a clean exit from inside. For example, create a file somewhere that the program periodically checks if it exists, and shuts itself down if it does (related reading: Terminating all processes with MPI).

share|improve this answer

The command I usually do this is to use killall -u [USER].

share|improve this answer

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.