我是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 outputesbatch脚本
#!/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有什么想法吗?
发布于 2019-05-17 17:23:25
尝试用以下代码替换您的for循环:
while read -r line;
do
if [[ $line == \#* ]]; continue ; fi
srun $line
done < shellscripthttps://stackoverflow.com/questions/56173819
复制相似问题