If there a reason you can't set the job name with either "sbatch --job-name=myname myscript.sh" or this in your script?
#SBATCH --job-name=myname That way SLURM_JOB_NAME should be set to what you expect. -----Original Message----- From: slurm-users <slurm-users-boun...@lists.schedmd.com> on behalf of Andreas Hilboll <hilboll+sl...@uni-bremen.de> Reply-To: Slurm User Community List <slurm-users@lists.schedmd.com> Date: Thursday, March 22, 2018 at 4:28 PM To: "slurm-users@lists.schedmd.com" <slurm-users@lists.schedmd.com> Subject: [slurm-users] set SLURM_JOB_NAME programmatically from within job script Hi, I'd like to be able to set the SLURM_JOB_NAME from within the script I'm submitting to `sbatch`. So, e.g., with the script `myscript.sh`, #!/bin/bash export SLURM_JOB_NAME='myname' sleep 120 and then `sbatch myscript.sh`, I'd like the job's name to be 'myname'. Is this somehow possible? When I tried the above approach, it didn't work (squeue reported the job's name to be 'myscript.sh'). Thanks for your help, Andreas