从 SLURM 了解 MaxRSS

Understanding MaxRSS from SLURM

我认为 MaxRSS 用于了解 SLURM 作业的内存需求;然而,现在我在质疑自己。

我收到来自 SLURM 的通知,说我的工作失败了。

SLURM Job_id=7347729 Name=job.cph.proband Ended, Run time 00:01:21, OUT_OF_MEMORY

我用sacct检查作业失败的原因;但是,看起来它失败了 OOM 错误。这很奇怪,因为它看起来只尝试使用请求的 3 Gb 中的 1.61 Gb(此处显示为 2.93)。

是我对 MaxRSS 的理解有误,还是这项工作因其他原因失败?

在此 wiki post 中建议作业管理器获取使用数据的速度可能不够快,无法跟踪内存使用量的峰值,sacct 工具会给您一个具体的答案:

SLURM's accounting mechanism is polling based and doesn't always catch spikes in memory usage. FSL's implementation uses a Linux kernel feature called "cgroups" to control memory and CPU usage. SLURM sets up a cgroup for the job with the appropriate limits which the Linux kernel strictly enforces.

The problem is simple: the kernel killed a process from the offending job and the SLURM accounting mechanism didn't poll at the right time to see the spike in usage that caused the kernel to kill the process.

您的 sacct 调用在 3 GB 作业被取消之前显示 1.6 GB 的使用量可能暗示了您的进程如何使用内存。

您的进程使用的数据结构可能需要随着其增长而调整大小。在重新分配该数据的过程中,您的进程可能会临时请求比 Slurm 可用于该作业的内存块更大的内存块。

根据实现,C++ std::vector,例如,may try to create a temporary, new vector that is twice or some other multiple of size,一旦添加了足够的元素,就会从旧向量复制数据。

笼统地说,在不知道您的具体情况的情况下 运行,临时创建一个大小为 1.6 GB 两倍的数据结构似乎足以触发作业取消,在你的例子,除了任何已经分配的space。