[slurm-users] Slurm prolog export variable

422 views
Skip to first unread message

Yap, Mike

unread,
Mar 22, 2021, 10:13:14 PM3/22/21
to slurm...@lists.schedmd.com

Hi All

 

Can anyone assist the following

 

We’re using Bright Cluster 9.1 with CentOS 7.9 running with slurm 2.02.6

We have a script running on prolog exporting the SCRATCH as variable for user running job

Addition command on the script to create a user folder accordingly

 

When submitting the job, the folder is created without any error on the compute node (which indicate the prolog is being executed without an issue) but $SCRATCH seems to be undone once the prolog script is done

We also tried to create an additional script to only export SCRATCH but no luck

We have been using the same script for an older setup and it work fine. Any suggestion if there is any workaround to define $SCRACTH beside getting user to define it in their submit script ?

 

Prolog script

#!/bin/sh

export SCRATCH=/scratch/$SLURM_JOB_USER/$SLURM_JOB_ID

mkdir --parents $SCRATCH

 

Thanks

Mike

 

 

Juergen Salk

unread,
Mar 23, 2021, 3:39:38 AM3/23/21
to Slurm User Community List
Hi Mike,

for pushing environvent variables into the job environment, you'll have to
use the TaskProlog script (not the regular Prolog script).

The location of the TaskProlog script needs to be defined in
slurm.conf, e.g.

TaskProlog=/etc/slurm/task_prolog

and the standard output of TaskProlog can be used to export
custom environvent variables, e.g.

echo "export SCRATCH=/scratch/$SLURM_JOB_USER/$SLURM_JOB_ID"

There is some more information on TaskProlog in the slurm.conf
man page and also here: https://slurm.schedmd.com/prolog_epilog.html

Best regards
Jürgen

--
Jürgen Salk
Scientific Software & Compute Services (SSCS)
Kommunikations- und Informationszentrum (kiz)
Universität Ulm
Telefon: +49 (0)731 50-22478
Telefax: +49 (0)731 50-22471


* Yap, Mike <M....@massey.ac.nz> [210323 02:12]:

Yap, Mike

unread,
Mar 23, 2021, 5:16:29 PM3/23/21
to Slurm User Community List
Hi Jürgen

Thanks for the help 😊 TaskProlog did get the job done

Regards
Mike
Reply all
Reply to author
Forward
0 new messages