Search code examples
ipython-parallel

How to stop an IPython cluster without the ipcluster command


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


Solution

  • 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.