首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用SLURM遍历脚本?(sbatch和srun)

如何使用SLURM遍历脚本?(sbatch和srun)
EN

Stack Overflow用户
提问于 2019-05-17 01:31:21
回答 1查看 2K关注 0票数 1

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

shell脚本:

代码语言:javascript
复制
#!/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

sbatch脚本

代码语言:javascript
复制
#!/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

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2019-05-17 17:23:25

尝试用以下代码替换您的for循环:

代码语言:javascript
复制
while read -r line; 
do 
    if [[ $line == \#* ]]; continue ; fi
    srun $line
done < shellscript
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56173819

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档