3

I don't start my IPython cluster with the ipcluster command but with the individual commands ipcontroller and ipengine because I use several machines over a network. When starting the cluster with the ipcluster command, stopping the cluster is rather straightforward:

ipcluster stop

However, I haven't been able to found the procedure when using the individual commands separately.

Thanks for your help

PierreE
  • 675
  • 1
  • 11
  • 23

1 Answers1

7

The easiest way is by connecting a Client and issuing a shutdown command:

import ipyparallel as ipp
c = ipp.Client()
c.shutdown(hub=True)

Client.shutdown() shuts down engines; adding hub=True tells it to bring down the central controller process as well.

minrk
  • 37,545
  • 9
  • 92
  • 87
  • 1
    Thanks, it works as expected. Is there a way to do this without using a python interpreter? – PierreE Oct 13 '15 at 17:34
  • @PierreE You could call this in one line from a python script (`python -c 'import ipyparallel as ipp; c=ipp.Client(); c.shutdown(hub=True)`')... Not sure of your question - what can you not do that is constraining you? You could put the above in a shell script and execute that. Otherwise you can put the above in a jupyter cell. You could also kill the various processes in the worst case. What did you try for the `ipcontroller`/`ipengine` route? – jtlz2 Mar 31 '21 at 12:02