简体   繁体   English

调用 dask scheduler story 函数时出错

[英]Error when calling dask scheduler story function

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.因此,我几乎逐字逐句地从 dask 文档中遵循此示例https://distributed.dask.org/en/stable/logging.html#task-transition-logs ,但无法使其正常工作。 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) . TypeError: send_recv_from_rpc() takes 0 positional arguments but 1 was givenclient.scheduler.story(f.key)行上给出了 1 个。

You are very close, to access the scheduler use the client.cluster.scheduler , so the relevant code would look like this:您非常接近,要访问调度程序,请使用client.cluster.scheduler ,因此相关代码如下所示:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM