[slurm-users] Job error when using --job-name=`basename $PWD`

Sven Hansen s.hansen at itc.rwth-aachen.de
Mon Jul 29 09:35:06 UTC 2019


Hi Fabio,

SLURM does not support usual shell expression evaluation or arbitrary 
variable substitution within #SBATCH arguments. If the option parser 
comes across options it does not understand, it tends to abort and 
assumes default settings for all mandatory unset options. This can be 
nasty for newcomers because it happens silently.

If you need to set job arguments dynamically, altering a basic jobscript 
frame with a programming language of your choice is the go-to option. As 
so often, sed does the trick very well.

Best,
Sven

Am 29.07.2019 um 08:22 schrieb Marcus Boden:
> Hi Fabio,
>
> are you sure that command substition works in the #SBATCH part of the
> jobscript? I don't think that slurm actally evaluates that, though I
> might be wrong.
>
> It seems like the #SBATCH after the --job-name line are not evaluated
> anymore, therefore you can't start srun with two tasks (since slurm only
> allocates one).
>
> Best regards,
> Marcus
>
> On 19-07-29 05:51, Verzelloni  Fabio wrote:
>> Hi Everyone,
>> I'm experiencing a weird issue, when submitting a job like that:
>> -------------------------
>> #!/bin/bash
>> #SBATCH --job-name=`basename $PWD`
>> #SBATCH --ntasks=2
>> srun -n 2 hostname
>> -------------------------
>> Output:
>> srun: error: Unable to create step for job 15387: More processors requested than permitted
>>
>> If I submit a job like that:
>> -------------------------
>> #!/bin/bash
>> #SBATCH --job-name=myjob
>> #SBATCH --ntasks=2
>> srun -n 2 hostname
>> -------------------------
>> Output:
>> Mynode-001
>> Mynode-001
>>
>> If I decrease the number of task it works fine:
>> -------------------------
>> #!/bin/bash
>> #SBATCH --job-name=`basename $PWD`
>> #SBATCH --ntasks=1
>> srun -n 1 hostname
>> -------------------------
>> Output:
>> Mynode-001
>>
>> The slurm version is 18.08.8, is that a bug in slurm?
>>
>> Thanks
>> Fabio
>>
>> --
>> - Fabio Verzelloni - CSCS - Swiss National Supercomputing Centre
>> via Trevano 131 - 6900 Lugano, Switzerland
>> Tel: +41 (0)91 610 82 04
>>   
>>



More information about the slurm-users mailing list