Skip to content

Commit

Permalink
SVCPLAN-5511: Fix parsing of long partition lists
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmaloney committed May 20, 2024
1 parent 38a5a87 commit 6cc093e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/slurm_detail_stats.sh.epp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tfile3=$(mktemp /tmp/nodeinfo.XXXXXX)
tfile4=$(mktemp /tmp/pending.XXXXXX)

##Dump info about all running jobs into a temp file; get the list of all nodes in the system
"${slurm_path}"/squeue -t running -O Partition:50,NodeList:250,tres-alloc:70,username | grep -v TRES_ALLOC | awk '{print $1","$2","$3","$4}' > "${tfile2}"
"${slurm_path}"/squeue -t running -O Partition:75,NodeList:250,tres-alloc:70,username | grep -v TRES_ALLOC | awk '{print $1","$2","$3","$4}' > "${tfile2}"
all_node_list=($("${slurm_path}"/sinfo -N | grep -v NODELIST | awk '{print $1}' | sort -u | xargs))

## Loop over that list of jobs running and get the data formatted in consistent way
Expand Down Expand Up @@ -178,7 +178,7 @@ do
done

##Dump info about all pending jobs into a temp file
"${slurm_path}"/squeue -t pending -O Partition:50,tres-alloc:70,username | grep -v TRES_ALLOC | awk '{gsub(/,/,";",$1); print}' | awk '{print $1","$2","$3","$4}' | sed 's/cpu=//' | sed 's/mem=//' | sed -re 's/(.[0-9])([A-Z],node=.)/\1,\2/' | sort | uniq -c | sed 's/\ /,/g' | sed 's/^,*//' > "${tfile}"
"${slurm_path}"/squeue -t pending -O Partition:150,tres-alloc:70,username | grep -v TRES_ALLOC | awk '{gsub(/,/,";",$1); print}' | awk '{print $1","$2","$3","$4}' | sed 's/cpu=//' | sed 's/mem=//' | sed -re 's/(.[0-9])([A-Z],node=.)/\1,\2/' | sort | uniq -c | sed 's/\ /,/g' | sed 's/^,*//' > "${tfile}"

## Loop over that list of jobs running and get the data formatted in consistent way
while read -r p; do
Expand Down

0 comments on commit 6cc093e

Please sign in to comment.