[slurm-users] Job walltime

Chris Samuel chris at csamuel.org
Thu Oct 18 05:47:16 MDT 2018

On Wednesday, 17 October 2018 10:10:07 PM AEDT Andy Georges wrote:

> I am wondering is there is a way to set the job walltime in the job
> environment (to set $PBS_WALLTIME). It’s unclear to me how this information
> can be retrieved on the worker node, e.g., in the SPANK environment
> (prolog, or in each job step).

You can set arbitrary variables for a user from the task prolog script.

A quick *untested* example hack (caveat emptor, batteries not included):

echo "export SLURM_WALLTIME=$(squeue -j ${SLURM_JOB_ID} -o %l -h | head -n1)"

WARNING:  the head -n1 is there because if the job is the first element of a 
job array it'll return the walltimes of every element in the job array, not 
just the element in question.

Note that this means that jobs of longer than 1 day will get reported in the 
day-hour:minute:second format, for example "6-16:00:00".

Hope this helps!

All the best,
 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC

More information about the slurm-users mailing list