I have a batch file to send a job with sbatch
.
The contents of the batch file is
# Setting the proper SBATCH variables
...
#SBATCH --error="test_slurm-%j.err"
#SBATCH --output="test_slurm-%j.out"
...
WORKDIR=.
echo "Run 1"
${WORKDIR}/test_slurm
echo "Run 2"
${WORKDIR}/test_slurm
File test_slurm-%j.out
is sometimes appended with output only after each of the lines is finished.
For instance, the output of the first instance of test_slurm
would not be dumped into test_slurm-%j.out
until test_slurm
finishes.
Is there any way of having stdout/stderr "flushed" at runtime, so I can check file test_slurm-%j.out
to monitor execution?
As per How to change how frequently SLURM updates the output file (stdout)? and https://unix.stackexchange.com/questions/25372/turn-off-buffering-in-pipe I tried with
stdbuf -oL -eL ${WORKDIR}/test_slurm
stdbuf -o0 -e0 ${WORKDIR}/test_slurm
stdbuf -o1 -e1 ${WORKDIR}/test_slurm
unbuffer ${WORKDIR}/test_slurm
None of this worked.
This does not seem to provide the answer.