Repository navigation
Expand file tree
/
Copy pathset_cutoffs
More file actions
executable file
·50 lines (44 loc) · 1.53 KB
/
Copy pathset_cutoffs
File metadata and controls
executable file
·50 lines (44 loc) · 1.53 KB
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
#!/bin/bash
# Copyright (c) 2020-2023 Homa Developers
# SPDX-License-Identifier: BSD-1-Clause
# This script sets the cutoffs for unscheduled priorities on one or more
# nodes to match the characteristics of the Homa workloads.
#
# Usage:
# set_cutoffs workload num_nodes [first]
#
# The "workload" argument must be one of w1-w5; the cutoffs will be set
# to values appropriate for that workload. The "num_nodes" arguments indicates
# how many servers should be updated. The "first" argument is optional; it
# is an integer identifying the first node on which installation will occur
# (e.g. "set_cutoffs w3 4 2" means node2 through node5 will be updated.
# "first" defaults to 0.
root=~/homaModule
if [ $# -eq 3 ]; then
first=$3
elif [ $# -eq 2 ]; then
first=0
else
echo "Usage: set_cutoffs workload num_nodes [first]"
exit 1
fi
last=`expr $first + $2 - 1`
if [ $1 = w1 ]; then
cutoffs="1000000 12288 2112 1280 832 576 384 192"
elif [ $1 = w2 ]; then
cutoffs="1000000 1000000 1000000 7168 1920 640 448 320"
elif [ $1 = w3 ]; then
cutoffs="1000000 1000000 1000000 1000000 1000000 63488 12288 3008"
elif [ $1 = w4 ]; then
cutoffs="1000000 1000000 1000000 1000000 1000000 1000000 1000000 68608"
elif [ $1 = w5 ]; then
cutoffs="1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000"
else
echo "Unknown workload '$1'; must be w1-w5"
exit 1
fi
for ((i = $first ; i <= $last; i++)); do
node=node$i
echo '*** Updating cutoffs on' $node '***'
ssh $node sudo sysctl /net/homa/unsched_cutoffs=\"$cutoffs\"
done