-
Notifications
You must be signed in to change notification settings - Fork 6
/
gpus_users.bashrc
51 lines (45 loc) · 1.51 KB
/
gpus_users.bashrc
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
usage_by_lab() {
{
sacctmgr -nop show assoc format=account,user,grptres | grep -v 'root' | grep -v 'test-lab';
squeue -O "UserName,StateCompact,QOS,tres-alloc:1000,Account,Partition" -h | tr -s " " | awk '$0="G> "$0' | grep gpu | sort;
} | awk -f $1 -
}
usage_by_node() {
{ sinfo -o '%n %G %O %e %a %C %T' -S '-O'; squeue -o "G> %N %P [%t] %b %q %C" -h | grep "\[R\]"; } | awk -f $1 -
}
usage_by_node_type() {
{ sinfo -o '%f %n' -S '-f';
squeue -O "UserName,StateCompact,QOS,tres-alloc:1000,Account,Partition,tres-per-node,NodeList" -h | tr -s " " | awk '$0="G> "$0' | grep gpu | sort;
} | awk -f $1 -
}
gpus_users() {
if [ $# -eq 1 ]; then
if [[ $1 == "-q" ]]; then
usage_by_lab ~/slurm_usage_utils/lab_usage_qos.awk
elif [[ $1 == "-v" ]]; then
usage_by_lab ~/slurm_usage_utils/lab_usage_verbose.awk
fi
else
usage_by_lab ~/slurm_usage_utils/lab_usage.awk
fi
}
node_usage() {
if [ $# -eq 1 ]; then
if [[ $1 == "-q" ]]; then
usage_by_node ~/slurm_usage_utils/node_usage.awk
elif [[ $1 == "-v" ]]; then
usage_by_node ~/slurm_usage_utils/node_usage.awk
fi
else
usage_by_node ~/slurm_usage_utils/node_usage.awk
fi
}
gpu_types_users() {
if [ $# -eq 1 ]; then
if [[ $1 == "-v" ]]; then
usage_by_node_type ~/slurm_usage_utils/gpu_types_usage_verbose.awk
fi
else
usage_by_node_type ~/slurm_usage_utils/gpu_types_usage.awk
fi
}