[slurm-users] Multiple Program Runs using srun in one Slurm batch Job on one node
Frank Lenaerts
frank.lenaerts at sckcen.be
Wed Jun 15 13:49:32 UTC 2022
On Wed, Jun 15, 2022 at 02:20:56PM +0200, Guillaume De Nayer wrote:
> In order to solve this problem I'm trying to start some subtasks with
> srun inside a batch job (without mpirun for now):
>
> #!/bin/bash
> #SBATCH --job-name=test_multi_prog_srun
> #SBATCH --nodes=1
> #SBATCH --partition=short
> #SBATCH --time=02:00:00
> #SBATCH --exclusive
>
> srun -vvv --exact -n1 -c1 sleep 20 > srun1.log 2>&1 &
> srun -vvv --exact -n1 -c1 sleep 30 > srun2.log 2>&1 &
> wait
>
>
> However, only one task runs. The second is waiting for the completion of
> the first task to start.
>
> Can someone explain me, what I'm doing wrong?
I think this is because the value for sbatch(1)'s -n (or --ntasks) is
1 (per node) by default.
> Thx in advance,
> Regards,
Kind regards
> Guillaume
Frank
More information about the slurm-users
mailing list