Skip to content

Commit

Permalink
More bin/sq improvements
Browse files Browse the repository at this point in the history
Issue 1391: Looks directly at `QUEUESYS` to determine report running
job information. On a loaded system (e.g., local Debian SMP machine)
using `bin/guess` and grep'ing over machine names was taking forever.
`QUEUESYS` is sufficient to decide what method to use.

Related to #1391
  • Loading branch information
wwlwpd committed Sep 19, 2024
1 parent 9fe52af commit 02e10a8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions bin/sq
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ fi
_sq() {
OLDIFS=$IFS
IFS=$'\n'
platform=$(guess platform);
if [[ $(echo 'supermic queenbee queenbeeC queenbeeD' | grep -c "$platform") -gt 0 ]]; then
if [[ "$QUEUESYS" == "PBS" ]]; then
SQ=$(showq | grep $USER)
elif [[ "$QUEUESYS" == "SLURM" || $(echo 'frontera stampede2 stampede3 lonestar5 hatteras rostam ls6 mike' | grep -c "$platform") -gt 0 ]]; then
elif [[ "$QUEUESYS" == "SLURM" ]]; then
SQ=$(squeue -u $USER --noheader -o " %.18i %.30j %T %.10M" 2>&1)
for status in $SQ; do
id=$(echo "$status" | awk '{print $1}')
Expand All @@ -24,13 +23,10 @@ _sq() {
echo "No jobs in queue for user '$USER'".
fi
elif [[ "$QUEUESYS" == "mpiexec" ]]; then
top -n 1 -u $USER
ps -ejHu $USER # lists processes
uptime # gives load info
else
echo "Can't determine platform or command to use to report state of batch queues. Guessing:" >&2
SQ=$(squeue -u $USER --noheader -o " %.18i %.30j %T %.10M" 2>&1)
if [ -z "$SQ" ]; then
echo "No jobs in queue for user '$USER'".
fi
echo "$0 - Can't determine platform or command to use to report state of batch queues." >&2
fi
# display result
IFS=$OLDIFS
Expand Down

0 comments on commit 02e10a8

Please sign in to comment.