[slurm-users] Finding submitted job script

Kilian Cavalotti kilian.cavalotti.work at gmail.com
Tue Jul 10 15:02:28 MDT 2018


On Tue, Jul 10, 2018 at 10:05 AM, Jessica Nettelblad
<jessica.nettelblad at gmail.com> wrote:
> In the master branch, scontrol write batch_script also has the option to
> write the job script to STDOUT instead of a file. This is what we use in the
> prolog when we gather information for later (possible) troubleshooting. So I
> suppose that'll be available from 18.08 without patching.
> https://github.com/SchedMD/slurm/commit/158551a7059702ba46eaab78168008fe75d1c070#diff-bc42eb80c8e7b0e26af71e04acab6aca

You can also retrieve the script from the spool dir directly, on the
Slurm controller:

SLURM_SPOOL_DIR=$(scontrol show config | awk -F'= '
'/StateSaveLocation/ {print $2}')
JOB_SCRIPT=$SLURM_SPOOLDIR/hash.${jobid: -1:1}/job.$jobid/script

If you need this in a prolog, you can use the PrologSlurmctld
facility, that runs on the Slurm controller.

Cheers,
-- 
Kilian



More information about the slurm-users mailing list