mpi运行 with slurm : 如何 运行 在单个 CPU 上处理多个进程

mpirun with slurm : how to run multiple processes on a single CPU

我想将 slurm 批处理 (sbatch) 写入 运行 几个 mpi 应用程序。因此我希望能够 运行 类似的东西

salloc --nodes=1 mpirun -n 6 hostname 

但我收到这条消息:

There are not enough slots available in the system to satisfy the 6 slots that were requested by the application: hostname

Either request fewer slots for your application, or make more slots available for use.

节点实际有4个CPU。因此,我正在寻找允许每个 CPU 完成更多任务的东西,但我找不到合适的选项。我知道当物理资源丢失时,单独的 mpi 能够 运行 多个进程。我认为问题出在 slurm 方面。 你有suggestions/comments吗?

使用 srun 并提供选项 --overcommit,例如像那样:

test.job:

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=6
#SBATCH --overcommit

srun hostname

运行 sbatch test.job

来自man srun

Normally, srun will not allocate more than one process per CPU. By specifying --overcommit you are explicitly allowing more than one process per CPU.

请注意,根据您的集群配置,这可能也适用于 mpirun,也可能不适用,但我会坚持使用 srun,除非您有充分的理由不这样做。

一个重要的警告:默认情况下,大多数 MPI 实现在 运行 过度使用时具有 糟糕的性能。如何解决这个问题是一个不同的、更困难的问题。