-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_runner_flop.sh
executable file
·52 lines (43 loc) · 1.03 KB
/
test_runner_flop.sh
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
#!/bin/sh
# Set the range of n values
min_n=4
max_n=2048
# Initialize a flag for failed tests
tests_failed=0
# Ask the user for input
echo "Please enter a version name:"
read input
if echo "$input" | grep -Eq '^([[:alnum:]_]+)[[:space:]]+([[:alnum:]_]+)$'; then
version=$(echo "$input" | awk '{print $1}')
blas=$(echo "$input" | awk '{print $2}')
echo "Version: $version"
echo "n: $blas"
else
echo "Input does not match the expected format."
fi
if [ "$blas" = "y" ]; then
blas="S"
else
blas="N"
fi
version_name=$version
# Run the 'make N={n}' command for each n value
rm -f ./data_collection/$version_name/flops.txt
while [ $min_n -le $max_n ]; do
echo -n "Running test for N=$min_n "
make cleanobj > /dev/null
make N=$min_n V=$version_name FLOP=S ROOFLIN=N NO_BLA=$blas >> ./data_collection/$version_name/flops.txt
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "❌"
tests_failed=1
else
echo "✅"
fi
min_n=$((min_n * 2))
done
if [ $tests_failed -eq 1 ]; then
exit 1
else
exit 0
fi