Sbatch中的Sbatch提交脚本是否真的需要SRUN命令来运行预期的命令,还是可以直接运行它们?
我正在浏览给定的示例脚本,但它使用SRUN来运行命令。我对此表示怀疑。我可以在我的sbatch提交脚本中直接运行我想要的命令,例如,例如
bash main.sh
或
python main.py
例如。提交脚本我得到了main_submit_to_slurm.sh
:
#!/bin/bash
#SBATCH --job-name="example"
#SBATCH --output="example.%j.%N.out"
#SBATCH --partition=x86
#SBATCH --time=1:00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=32
#SBATCH --sockets-per-node=1
#SBATCH --cores-per-socket=16
#SBATCH --threads-per-core=2
#SBATCH --mem-per-cpu=4000
#SBATCH --gres=gpu:a100:1
#SBATCH --export=ALL
cd ~
echo STARTING `date`
srun hostname # does this really need srun?
# which is correct?
# python -u main.py # OPTION 1
# srun python -u main.py #OPTION 2
``
do we really need to have srun inside an sbatch submission file?
I was going through an example script given but it uses srun to run the command. I am skeptical is that is really needed. Can I just run the command I want directly without srun in my sbatch submission script e.g. just
bash main.sh
or
python main.py
e.g. submission script I was given main_submit_to_slurm.sh
:
#!/bin/bash
#SBATCH --job-name="example"
#SBATCH --output="example.%j.%N.out"
#SBATCH --partition=x86
#SBATCH --time=1:00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=32
#SBATCH --sockets-per-node=1
#SBATCH --cores-per-socket=16
#SBATCH --threads-per-core=2
#SBATCH --mem-per-cpu=4000
#SBATCH --gres=gpu:a100:1
#SBATCH --export=ALL
cd ~
echo STARTING `date`
srun hostname # does this really need srun?
# which is correct?
# python -u main.py # OPTION 1
# srun python -u main.py #OPTION 2
``
do we really need to have srun inside an sbatch submission file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论