0

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?
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323

0 Answers0