-
Notifications
You must be signed in to change notification settings - Fork 2
/
qinfo
executable file
·83 lines (72 loc) · 2.42 KB
/
qinfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# fetch queue info for website
# Ruoshi Sun
# 2024-01-18
CSV=qinfo.csv
echo "Partition,Purpose,Max time / job,Max nodes / job,Max cores / job,Max cores / node,Default memory / core,Max memory / node / job,SU Charge Rate" > $CSV
for p in standard parallel gpu interactive; do
# MaxTime, MaxNodes, DefMemPerCPU
eval $(scontrol show partition -o $p|tr ' ' '\n')
# MaxTime
case $p in
dev|interactive)
# assume time limit is X hours
MaxTime="$(echo $MaxTime | awk -F':' '{printf "%d", $1}') hours"
;;
*)
# assume time limit is X days
MaxTime="$(echo $MaxTime | awk -F'-' '{printf "%d", $1}') days"
;;
esac
DefMemPerCPU="$((DefMemPerCPU/1000))GB"
# MaxCoresPerJob
case $p in
standard)
MaxCoresPerJob=$(sacctmgr show qos -np $QoS | awk -F'|' '{sub("cpu=","",$17); print $17}')
;;
gpu)
MaxCoresPerJob="$(sacctmgr show qos -np $QoS | awk -F'|' '{sub("gres/gpu=","",$20); print $20}')GPU"
;;
interactive)
MaxCoresPerJob="24/2GPU"
;;
*)
MaxCoresPerJob=$(sacctmgr show qos -np $QoS | awk -F'|' '{sub("cpu=","",$16); print $16}')
;;
esac
# weka client takes 3 cores except parallel
# 2024-07-02 weka non-dedicated
MaxCoresPerNode=$(sinfo -p $p -ho '%n %c'|sort -nk2|tail -1|awk '{print $2}')
# MaxMemPerNode
case $p in
standard)
#MaxMemPerNode="$((MaxMemPerCPU * (MaxCoresPerJob+3) / 1024))GB"
MaxMemPerNode="1462GB"
;;
largemem)
MaxMemPerNode="$((MaxMemPerCPU * MaxCoresPerJob / 1024))GB"
;;
interactive)
MaxMemPerNode="216GB"
;;
*)
MaxMemPerNode="$(sinfo -p $p -ho '%n %m'|sort -nk2|tail -1|awk '{printf "%d\n", $2/1024}')GB"
;;
esac
# SU charge rate
case $p in
dev) SUCharge=0 ;;
gpu) SUCharge=3 ;;
*) SUCharge=1 ;;
esac
# Purpose
case $p in
standard) Purpose="For jobs on a single compute node" ;;
parallel) Purpose="For large parallel jobs on up to $MaxNodes nodes" ;;
#largemem) Purpose="For memory intensive jobs" ;;
gpu) Purpose="For jobs using general purpose graphical processing units" ;;
#dev) Purpose="For quick tests" ;;
interactive) Purpose="For quick interactive sessions" ;;
esac
echo "$p,$Purpose,$MaxTime,$MaxNodes,$MaxCoresPerJob,$MaxCoresPerNode,$DefMemPerCPU,$MaxMemPerNode,$SUCharge" >>$CSV
done