调用 dask scheduler story 函数时出错
Error when calling dask scheduler story function
所以我几乎逐字逐句地遵循了 dask 文档中的这个示例
https://distributed.dask.org/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() takes 0 positional arguments but 1 was given
在线 client.scheduler.story(f.key)
.
你非常接近,要访问调度程序使用 client.cluster.scheduler
,因此相关代码如下所示:
print(client.cluster.scheduler.story(f.key))
# print the story
所以我几乎逐字逐句地遵循了 dask 文档中的这个示例 https://distributed.dask.org/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() takes 0 positional arguments but 1 was given
在线 client.scheduler.story(f.key)
.
你非常接近,要访问调度程序使用 client.cluster.scheduler
,因此相关代码如下所示:
print(client.cluster.scheduler.story(f.key))
# print the story