2

I need to cancel a parallel processing simulation that I started on a Linux server using R.

Last night I connected to the server using ssh and started the simulation from the shell with the nohup command: nohup R CMD BATCH mysimulation.R

The mysimulation.R file uses the mclapply command in the multicore package to spawn additional instances of R to run the simulation in parallel. For instance, when I run top in the shell I see ten different instances of R running, then finishing a run of the simulation, then starting again to continue with the additional simulation replications.

I have almost no experience working directly with a Linux server (the extent of my knowledge is cd, ls, and the nohup command mentioned above). I searched around a bit for a solution and thought killing the process might work. I tried:

kill -9 mypid (which said it killed the process).

However, the simulation continues to run. I can see the instances of R continuing to run, close, and respawn. Can anyone point me to resources or walk me through the specific steps I need to take to shut down this simulation? Thanks.

Community
  • 1
  • 1

2 Answers2

2

It seems you need to kill several processes at once. Maybe one of the answers to the post Best way to kill all child processes might help you.

Community
  • 1
  • 1
Håvard
  • 87
  • 7
  • I could not make the top answers work from the link, but manually went through and killed the individual child processes listed and that seemed to work. Thanks for the pointer. – user1715965 Oct 03 '12 at 22:25
0

You may see this page. I hope this would help

Ali
  • 9,440
  • 12
  • 62
  • 92