Skip to content

Commit

Permalink
Merge pull request ubccr#8 from jbednasz/update-outputs
Browse files Browse the repository at this point in the history
snodes: Expanded output field for gres
  • Loading branch information
aebruno authored May 15, 2020
2 parents ff5164c + 8b17f7b commit 2c5e215
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions bin/snodes
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ fi
# so use grep filter instead....
if [ "$cluster" != "all" ]; then
if [ "$3" == "mix" -o "$3" == "mixed" ]; then
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %8G %18P %f" | grep -v "^CLUSTER" | head -n1
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %8G %18P %f" | grep -v "^CLUSTER" | grep 'mix'
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %12G %18P %f" | grep -v "^CLUSTER" | head -n1
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %12G %18P %f" | grep -v "^CLUSTER" | grep 'mix'
else
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %8G %18P %f" | grep -v "^CLUSTER"
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %12G %18P %f" | grep -v "^CLUSTER"
fi
else
if [ "$3" == "mix" -o "$3" == "mixed" ]; then
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %8G %18P %f" | head -n1
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %8G %18P %f" | grep 'mix'
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %12G %18P %f" | head -n1
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %12G %18P %f" | grep 'mix'
else
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %8G %18P %f"
sinfo $OPTIONS -o "%13n %8t %4c %8z %15C %8O %8m %12G %18P %f"
fi
fi

Expand Down
16 changes: 8 additions & 8 deletions bin/sranks
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ if [ "$arg1" == "" ]; then
arg1=`echo $@ | tr ' ' '\n' | grep '\-\-full'`
fi

echo "RANK USER JOBID PRIORITY ____COMPONENTS_OF_TOTAL_PRIORITY_____"
echo "==== ======== ====== ======== AGE FSHARE JOBSIZ PARTITION QOS"
echo "RANK USER JOBID PRIORITY _______COMPONENTS_OF_TOTAL_PRIORITY________"
echo "==== ======== ====== ======== AGE FSHARE JOBSIZ PARTITION QOS TRES"

# ---------------------------------------------------------------------------
# raw ranks don't take into account scheduler configuration, just priorities.
# ---------------------------------------------------------------------------
if [ "$arg1" == "--raw" ]; then
sprio $cArg -h -o "%u %i %Y %A %F %J %P %Q" | grep -v "^CLUSTER" |
sprio $cArg -h -o "%u %i %Y %A %F %J %P %Q %T" | grep -v "^CLUSTER" |
sort -gr -k3 |
awk '{ printf("%4d %-8s %-6s %8s %6s %6s %6s %9s %3s\n", NR-1, $1,$2,$3,$4,$5,$6,$7,$8); }'
awk '{ printf("%4d %-8s %-6s %8s %6s %6s %6s %9s %3s\n", NR-1, $1,$2,$3,$4,$5,$6,$7,$8,$9); }'
# ---------------------------------------------------------------------------
# The "full" pending option will include all jobs in the displayed list but
# will mark those not considered by the scheduler.
Expand Down Expand Up @@ -97,11 +97,11 @@ elif [ "$arg1" == "--full" ]; then
if [ -f $TMPFILE ]; then
cat $TMPFILE |
sort -gr -k3 |
awk '{ printf("%4d %-8s %-6s %8s %6s %6s %6s %9s %3s\n", NR-1, $1,$2,$3,$4,$5,$6, $7,$8); }' > $OUTFILE
awk '{ printf("%4d %-8s %-6s %8s %6s %6s %6s %9s %3s %9s\n", NR-1, $1,$2,$3,$4,$5,$6, $7,$8,$9); }' > $OUTFILE

# tack on unranked jobs
grep -v -x -f $TMPFILE $UNRFILE |
awk '{ printf("---- %-8s %-6s %8s %6s %6s %6s %9s %3s\n", $1,$2,$3,$4,$5,$6,$7,$8); }' >> $OUTFILE
awk '{ printf("---- %-8s %-6s %8s %6s %6s %6s %9s %3s %9s\n", $1,$2,$3,$4,$5,$6,$7,$8,$9); }' >> $OUTFILE

# display sorted results
cat $OUTFILE | sort -k4rg,4 -k3rg,1
Expand All @@ -128,13 +128,13 @@ else
rm -f $TMPFILE

for i in $userList; do
sprio $cArg -h --user=$i -o "%u %i %Y %A %F %J %P %Q" | grep -v "^CLUSTER" | sort -gr -k3 | head -n${JOBS_PER_USER} >> $TMPFILE
sprio $cArg -h --user=$i -o "%u %i %Y %A %F %J %P %Q %T" | grep -v "^CLUSTER" | sort -gr -k3 | head -n${JOBS_PER_USER} >> $TMPFILE
done

if [ -f $TMPFILE ]; then
cat $TMPFILE |
sort -gr -k3 |
awk '{ printf("%4d %-8s %-6s %8s %6s %6s %6s %9s %3s\n", NR-1, $1,$2,$3,$4,$5,$6, $7,$8); }'
awk '{ printf("%4d %-8s %-6s %8s %6s %6s %6s %9s %3s %9s\n", NR-1, $1,$2,$3,$4,$5,$6, $7,$8,$9); }'
fi

rm -f $TMPFILE
Expand Down

0 comments on commit 2c5e215

Please sign in to comment.