调用dask调度程序故事功能时出错

发布于 2025-01-28 01:45:55 字数 882 浏览 3 评论 0原文

因此,我在Dask文档中遵循此示例几乎逐字 https://dasteributed.dask.orgg/en/stable/ logging.html#task-transition-logs 但不能让它起作用。以下是我的代码:

import dask
import time
import random
from dask_jobqueue import SLURMCluster
from distributed import Client

def dummy(x):
   time.sleep(5)
   return x

cluster = SLURMCluster(...) # you will need to put your queue name, cores, mem, etc...
client = Client(cluster)
f = client.submit(dummy, 2)
# we can sleep for a while for it to be finished

client.scheduler.story(f.key)
# client.scheduler.story(f) yields the same error

我收到此错误:

typeError:send_recv_from_rpc()获取0个位置参数,但在行 client> client.scheduler.story(f.key) >。

So I am following this example from dask documentation almost verbatim
https://distributed.dask.org/en/stable/logging.html#task-transition-logs
and but could not get it to work. Below is my code:

import dask
import time
import random
from dask_jobqueue import SLURMCluster
from distributed import Client

def dummy(x):
   time.sleep(5)
   return x

cluster = SLURMCluster(...) # you will need to put your queue name, cores, mem, etc...
client = Client(cluster)
f = client.submit(dummy, 2)
# we can sleep for a while for it to be finished

client.scheduler.story(f.key)
# client.scheduler.story(f) yields the same error

and I get this error:

TypeError: send_recv_from_rpc() takes 0 positional arguments but 1 was given on the line client.scheduler.story(f.key).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

找回味觉 2025-02-04 01:45:55

您非常接近,访问调度程序使用client.cluster.scheduler,因此相关代码看起来像这样:

print(client.cluster.scheduler.story(f.key))
# print the story

You are very close, to access the scheduler use the client.cluster.scheduler, so the relevant code would look like this:

print(client.cluster.scheduler.story(f.key))
# print the story
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文