Hi Lyn,
Thank you for your reply to my question. I’ve been exploring and experimenting
with the prolog and epilog today. So for example, I’ve put the following piece
of code in my “final” epilog, epilog.clean…
stdout=`/local/software/slurm/default/bin/scontrol show job ${SLURM_JOB_ID} |
grep -i stdout | cut -f2 -d '='`
#stdout=/local/software/slurm/default/etc/output
echo 'Hello World from Epilog.clean' >>$stdout
slurm.conf entry…
Epilog=/local/software/slurm/default/etc/slurm.epilog.clean
This does the job. There may be a more elegant way to do things, however this
does work. I do, however, get the ‘Hello World’ statement written twice in my
job output. I assume that this final epilog will be executed once at the end of
the job. Do you or anyone else on the forum understand why the statement is
echo’ed twice?
….
pi is approximately 3.1416009869231249, Error is 0.0000083333333318
wall clock time = 0.883930
Hello World from Epilog.clean
Hello World from Epilog.clean
….
Best regards,
David
From: Lyn Gerner [mailto:[email protected]]
Sent: Thursday, June 23, 2016 6:56 PM
To: slurm-dev <[email protected]>
Subject: [slurm-dev] Re: Writing to job output files from prolog and epilog
scripts
Hi David,
Be sure to note the special methods for setting env variables and writing to
stdout from the task prolog, in the Prolog and Epilog Guide web page. In order
to write job summary info (during one of your epilogs), you can acquire the
stdout location from scontrol show job ${SLURM_JOB_ID} and just echo to it.
Regards,
Lyn
On Thu, Jun 23, 2016 at 2:19 AM, Baker D.J.
<[email protected]<mailto:[email protected]>> wrote:
Hello,
I’m sure that this question has been asked before, however I don’t recall
finding a satisfactory answer to this question. We are investigating moving
from torque/moab to slurm on our HPC clusters. In our torque prologue and
epilogue scripts we write information in to users’ job output files. For
example where the job executed on the cluster (on which compute nodes) and how
many (much) resources the job used.
I’ve set up some prototype slurm prolog and epilog scripts and included some
write (echo) statements, however I don’t see any of the information in job
output files. Is writing information in to output files much more tricky in
slurm or have I missed something fundamental? Alternatively, are there other
ways and means of doing this? Could someone please advise me.
Best regards,
David