I use R to do parallel computing. Every time, when I want to kill the parallel program, I always use kill 2130 2131 6456
(PID). Is there a way to kill all the programs of R?
Asked
Active
Viewed 1,645 times
5

Ben
- 115
- 9
-
What do you mean by "kill"? Brutally stop the work in progress or stop the initialization of clusters after the work is done? Also, which package do you use to perform parallel computing? – Apr 15 '15 at 02:18
-
I want to stop it before it finishes. I use `foreach`. After I run the parallel program, I use `top` in the terminal to see the processes. I kill the process by `kill PID`. – Ben Apr 15 '15 at 02:24
1 Answers
9
Do
killall R
or
killall -9 R
So see the help pages for pgrep
and related utilities. Also useful is htop
instead of top
and just hitting k
for kill in it.
There are a bazillion such helper programs -- google for 'useful command-line programs' and eg this tutorial comes up.

Dirk Eddelbuettel
- 360,940
- 56
- 644
- 725