Here's a workaround that I use. It mimics the bpeek
functionality from LSF
Create a file bpeek.sh:
#!/bin/bash
# take as input an argument - slurm job id - and save it into a variable
jobid=$1
# run scontrol show job $jobid and save the output into a variable
#find the string that starts with StdOut= and save it into a variable without the StdOut= part
stdout=$(scontrol show job $jobid | grep StdOut= | sed 's/StdOut=//')
#show last 10 rows of the file if no argument 2 is given
nrows=${2:-10}
tail -f -n $nrows $stdout
Then you can use it:
sh bpeek.sh JOBID NROWS(optional)
Or add an alias to ~/.bashrc
file:
alias bpeek="sh ~/bpeek.sh $1 $2"
and then use it:
bpeek JOBID NROWS(optional)
Invalid job id specified
). The id I specify is identical to that output bysqueue
, though I'm not sure what 'step' to use. I don't usesrun
in my script, is that relevant? I ran my job withsbatch
and a bash script that has a few slurm parameters, loads a few modules,cd
and then runs a single python program. – Doralin