1 year ago

#370251

test-img

user2314737

IPyparallel: cannot remove cluster

I'm trying to use the function remove_cluster of ipyparallel.ClusterManager()

import ipyparallel as ipp
cluster = ipp.Cluster(n=2)
# start cluster syncronously
cluster.start_cluster_sync()
# <Cluster(cluster_id='1648998791-i14e', profile='default', controller=<running>, engine_sets=['1648998792'])>
cluster._is_running()
# True
# remove cluster
ipp.ClusterManager().remove_cluster(cluster_id='1648998791-i14e')

and I get the error message:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-33-fea95f8f114c> in <module>
      1 # remove cluster
----> 2 ipp.ClusterManager().remove_cluster(cluster_id='1648998791-i14e')

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ipyparallel/cluster/cluster.py in remove_cluster(self, cluster_id)
   1039         """Delete a cluster by id"""
   1040         # TODO: check running?
-> 1041         del self.clusters[cluster_id]
   1042 
   1043 

I get the same error also if I first stop the cluster. Here's the version of ipyparallel I'm using:

pip show ipyparallel
# Name: ipyparallel
# Version: 8.2.1

python

ipython

ipython-parallel

0 Answers

Your Answer

Accepted video resources