滞留着不同时限的DASK工作人员

2024-07-04 13:21:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用dask jobqueue在一个小型SLURM集群上启动许多2-5分钟的作业(使用子进程)。我总共运行了1000个作业,我希望偶尔让我的工人死,然后通过SLURM重新洗牌,以善待其他用户。在dask jobqueue文档站点上有一段话:

So, to get a large cluster quickly, we recommend allocating a dask-scheduler process on one node with a modest wall time (the intended time of your session) and then allocating many small single-node dask-worker jobs with shorter wall times (perhaps 30 minutes) that can easily squeeze into extra space in the job scheduler. As you need more computation, you can add more of these single-node jobs or let them expire.

这听起来很像我想做的,但我的问题是:如何配置它?你知道吗

如果我用完整运行所需的总工作时间(约24小时)设置集群,我就不知道如何用更短的工作时间启动Worker:

# setup cluster, launch one worker with 24hr walltime
In [1]:from dask_jobqueue import SLURMCluster
   ...:cluster = SLURMCluster(memory='8g',cores=4,walltime='24:00:00')
   ...:cluster.start_workers(1)
Out[1]:SLURMCluster(cores=0, memory=0 B, workers=0/1, jobs=0/1)

# try to launch a worker with shorter walltime???
In [2]:cluster.start_workers(100,walltime='00:30:00')
TypeError                                 Traceback (most recent call last)
<ipython-input-16-77ae6b0ed75d> in <module>
----> 1 cluster.start_workers(100,walltime='00:30:00')

TypeError: start_workers() got an unexpected keyword argument 'walltime'

如果我试着从30分钟开始,所有的工人同时死亡(通常)并导致DASK崩溃。你知道吗

我发现了一个example,在这里,额外的参数被传递给了单个worker,但是这些是资源,它们是在启动worker之后传递的(此时我假设walltime限制已经设置好了)。你知道吗

在初始化每个工作时,有没有办法为它们分配像walltime这样的属性?你知道吗


Tags: nodewith作业jobs集群startslurmdask
1条回答
网友
1楼 · 发布于 2024-07-04 13:21:41

您在这里指定的walltime是为worker指定的,而不是为scheduler指定的。你知道吗

SLURMCluster(memory='8g',cores=4,walltime='24:00:00')

调度程序在运行SLURMCluster对象的任何地方都会运行(假设您没有提到它,那么它可能在交互节点上?)你知道吗

你说得对,如果你同时启动所有工人,他们将同时死亡。如果您想让更多的工人来接替他们的位置,您可以考虑使用adapt方法来确保新工人来接替他们的位置。你知道吗

cluster.adapt(minimum=100, maximum=100)

相关问题 更多 >

    热门问题