title: Stopping a nohup parallel simulation in R
body: <p>I need to cancel a parallel processing simulation that I started on a Linux server using R.</p>
  
  <p>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</p>
  
  <p>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.</p>
  
  <p>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 <a href="https://stackoverflow.com/questions/8007380/how-to-kill-a-nohup-process">searched around a bit</a> for a solution and thought killing the process might work. I tried:</p>
  
  <p>kill -9 mypid (which said it killed the process).</p>
  
  <p>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.</p>