【问题标题】:How to loop through a script with SLURM? (sbatch and srun)如何使用 SLURM 循环遍历脚本? (批量和运行)
【发布时间】:2019-05-16 17:31:21
【问题描述】:

slurm 新手,我编写了一个脚本,它可以多次运行具有多个输入和输出的相同命令。如果我有另一个 shell 脚本,有没有办法可以在多个 srun 命令中循环遍历它。我认为你会是这样的人:

shell 脚本:

#!/bin/bash
ExCommand -f input1a -b input2a -c input3a -o outputa
ExCommand -f input1b -b input2b -c input3b -o outputb
ExCommand -f input1c -b input2c -c input3c -o outputc
ExCommand -f input1d -b input2d -c input3d -o outputd
ExCommand -f input1e -b input2e -c input3e -o outpute

批处理脚本

#!/bin/bash
## Job Name
#SBATCH --job-name=collectAlignmentMetrics
## Allocation Definition
## Resources
## Nodes
#SBATCH --nodes=1
## Time limir
#SBATCH --time=4:00:00
## Memory per node
#SBATCH --mem=64G
## Specify the working directory for this job

for line in shellscript
do
    srun command
done

有什么想法吗?

【问题讨论】:

    标签: bash slurm


    【解决方案1】:

    尝试用这个替换你的for循环:

    while read -r line; 
    do 
        if [[ $line == \#* ]]; continue ; fi
        srun $line
    done < shellscript
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-30
      • 2013-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      相关资源
      最近更新 更多