【问题标题】:How to run two multiprocessing programs in one batch using SLURM?如何使用 SLURM 批量运行两个多处理程序?
【发布时间】:2020-11-13 16:14:26
【问题描述】:

我有几个节点的 SLURM 集群,每个节点有 16 个 vcpus。我尝试运行以下代码:

#SBATCH --nodes 2
#SBATCH --ntasks 2
#SBATCH -c 16

srun --exclusive --nodes=1 program1 &
srun --exclusive --nodes=1 program2 &
wait

program1program2 每个需要 16cpus,我预计将分配 2 个具有 32 个内核的节点,program1 将在第一个节点上运行,program2 在第二个节点上运行,但我得到以下错误信息:

srun: error: Unable to create step for job 364966: Requested node configuration is not available

如果我只使用 --nodes--ntasks 键,sbatch 会分配 2 个节点和 2 个 CPU,如果我使用 --nodes-c 选项,我会收到应该定义 --ntasks 的消息。

如果我设置--ntasks=1,SLURM 将 nnodes 设置为 1。

如何在一个节点和 16 个 vcpus 上批量运行这两个程序?

【问题讨论】:

    标签: hpc slurm


    【解决方案1】:

    试试这个:

    #SBATCH --nodes 2
    #SBATCH --ntasks-per-node 16
    
    srun --exclusive -n 16 program1 &
    srun --exclusive -n 16 program2 &
    wait
    

    【讨论】:

      【解决方案2】:

      以下似乎有效:

      #SBATCH --nodes 2
      #SBATCH --exclusive
      
      srun --exclusive --nodes=1 -c 16 --ntasks 1 prog1 &
      srun --exclusive --nodes=1 -c 16 --ntasks 1 prog2 &
      wait
      

      【讨论】:

        猜你喜欢
        • 2011-07-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-04-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多