1

How do I stop the engines that have been started with: ipcluster engines --n=8 --daemonize

The currently running processes look like:

/usr/bin/python /usr/local/bin/ipcluster engines --n=8 --daemonize
/usr/bin/python -m IPython.parallel.engine --profile-dir /home/ubuntu/.ipython/profile_default --cluster-id  --log-to-file --log-level=20

I do not want to run killall python.

Alex Rothberg
  • 10,243
  • 13
  • 60
  • 120

1 Answers1

1

From a Client, you can call shutdown:

import IPython.parallel as ipp
rc = ipp.Client()
# shutdown specific engines
rc.shutdown([1, 5])
# shutdown all engines:
rc.shutdown()
# shutdown everything, including the Hub
rc.shutdown(hub=True)
minrk
  • 37,545
  • 9
  • 92
  • 87
  • Anyway to do this from the `CLI`? Ditto for the engines started on the master using `/usr/bin/python /usr/local/bin/ipcluster start --n=7 --delay=5 --daemonize`? I ask because [StarCluster seems to be incorrectly stoping the engines](https://github.com/jtriley/StarCluster/issues/538). – Alex Rothberg Jun 19 '15 at 17:50
  • `ipcluster stop` should shutdown everything. But there is no CLI API for doing anything selective. – minrk Jun 20 '15 at 18:28
  • (it may take a little while for engines not started with the controller to come down after `ipcluster stop`, since it takes some heartbeat cycles for them to notice, but they will bring themselves down. – minrk Jun 20 '15 at 18:29
  • After shutdown() it still running, CPU 100% in my case. – huang Jun 29 '21 at 05:50