Dask:从客户端获取调度程序地址
我正在使用Dask-MPI在HPC上部署。我想掌握与另一个库一起使用的调度程序地址。对于LocalCluster
(或任何其他明确群集定义),EG:
from dask.distributed import Client, LocalCluster
cluster = LocalCluster()
client = Client(cluster)
address = cluster.scheduler_address
但是dask-mpi
是初始化的,而无需群集对象, 这很简单。 :
from dask.distributed import Client
from dask_mpi import initialize
initialize()
client = Client()
尝试访问基础client.cluster
无济于事,因为在这种情况下,它将其设置为none
。
是否有其他方法可以从client
或其他地方获取调度程序地址?谢谢!
I'm using dask-mpi to deploy on my HPC. I'd like to get hold of the scheduler address to use with another library. This is simple in the case of a LocalCluster
(or any other explicit cluster definition) e.g.:
from dask.distributed import Client, LocalCluster
cluster = LocalCluster()
client = Client(cluster)
address = cluster.scheduler_address
But dask-mpi
is initialised without a cluster object:
from dask.distributed import Client
from dask_mpi import initialize
initialize()
client = Client()
Trying to access the underlying client.cluster
doesn't help as, in this case, it's set to None
.
Is there some other way to get hold of the scheduler address from the client
or elsewhere? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前尚未记录(至少我在 docs 中找不到它),但我发现
Client
对象具有scheduler
属性。地址和其他属性可以这样获取:我认为
client.scheduler
应该返回 Scheduler 对象,但我还没有做更多的挖掘。It's not currently documented (at least I couldn't find it in the docs), but I've found out that a
Client
object has ascheduler
property. The address, and other properties, can be obtained like:I would suppose
client.scheduler
should return a Scheduler object, but I haven't done much more digging, yet.这不是一个直接的解决方案,直接来自 docs,但一种方法是指定在哪里写入调度程序文件:
该文件将包含连接信息:
It's not a direct solution and comes straight from docs, but one way is to specify where to write the scheduler file:
The file will contain the connection info: