-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrol.sh
More file actions
executable file
·44 lines (37 loc) · 1.18 KB
/
control.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.18 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
SOURCE="main.cpp abstract_method.cpp concurrent_method.cpp independent_method.cpp"
OUTPUT="out.o"
FLAGS="-pthread"
if [ $1 = "build" ]; then
# Compile the C++ program
g++ -o $OUTPUT $SOURCE $FLAGS
echo "Compiled: $OUTPUT"
# For testing
elif [ $1 = "test" ]; then
HASH_BITS=2
NUM_THREADS=4
METHOD="1" # 0=concurrent;1=independent
VERBOSE="2"
AFFINITY_METHOD="no_affinity"
echo "Running: out.o $HASH_BITS $NUM_THREADS $VERBOSE $METHOD $AFFINITY_METHOD"
./out.o $HASH_BITS $NUM_THREADS $VERBOSE $METHOD $AFFINITY_METHOD
elif [ $1 = "run" ]; then
echo "Running: run.sh"
./run.sh $2
elif [ $1 = "multi" ] || [ $1 = "multi_numa" ]; then
echo "Running: run_multi_numa "
./run_multi_numa.sh
elif [ $1 = "no" ] || [ $1 = "no_affinity" ]; then
echo "Running: run_no_affinity"
./run_no_affinity.sh
elif [ $1 = "hyper" ] || [ $1 = "hyper_threading" ]; then
echo "Running: run_hyper_threading "
./run_hyper_threading.sh
elif [ $1 = "one" ] || [ $1 = "numa_0" ]; then
./run_numa_0.sh
elif [ $1 = "clean" ]; then
# Remove the compiled program
rm $OUTPUT
echo "Removed: $OUTPUT"
else
echo "Invalid argument: $1"
fi