[slurm-users] set SLURM_JOB_NAME programmatically from within job script

Vicker, Darby (JSC-EG311) darby.vicker-1 at nasa.gov
Thu Mar 22 15:54:39 MDT 2018


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-bounces at lists.schedmd.com> on behalf of Andreas Hilboll <hilboll+slurm at uni-bremen.de>
Reply-To: Slurm User Community List <slurm-users at lists.schedmd.com>
Date: Thursday, March 22, 2018 at 4:28 PM
To: "slurm-users at lists.schedmd.com" <slurm-users at 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




More information about the slurm-users mailing list