我使用以下命令从 Jupyter 笔记本创建本地集群:
from dask.distributed import Client, LocalCluster
cluster = LocalCluster(n_workers=24)
c = Client(cluster)
当内核被占用(计算操作)时,是否可以从另一台笔记本连接?
例如,我的目标是访问“total_occupancy”。
最佳答案
按照@moshevi的建议,您可以通过提供地址连接到调度程序。
client = Client("address-of-scheduler")
然后就可以使用client.run_on_scheduler
命令在远程调度器上执行操作
client.run_on_scheduler(lambda dask_scheduler: dask_scheduler.total_occupancy)
https://docs.dask.org/en/latest/futures.html#distributed.Client.run_on_scheduler
关于python - Dask - 如何连接到正在运行的集群调度程序并访问 'total_occupancy' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60115736/