-
Notifications
You must be signed in to change notification settings - Fork 3
/
run_all.sh
executable file
·51 lines (39 loc) · 1.44 KB
/
run_all.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
#!/bin/bash
echo -e "Run with $0 N len iter\n"
source build.sh
fcpp="mc/cpp-$1-$2-$3"
frust="mc/rust-$1-$2-$3"
rm mc/time*
echo -e "\n==> Rust v1: No dimensioned <=="
{ time ./target/release/no-units $1 $2 $3 $frust-1; } 2> mc/time-rust-1
echo -e "\n==> Rust v2: Dimensioned with non-generic vectors and units outside <=="
{ time ./target/release/units-outside $1 $2 $3 $frust-2; } 2> mc/time-rust-2
if diff $frust-2 $frust-1 &> /dev/null; then
echo -e "\nSame output as Rust v1"
else
echo -e "\nDIFFERENT! First 10 lines of output differences for Rust-2:"
diff -y $frust-2 $frust-1 | head -n10
fi
echo -e "\n==> Rust v3: Dimensioned with generic vectors and units inside <=="
{ time ./target/release/units-inside $1 $2 $3 $frust-3; } 2> mc/time-rust-3
if diff $frust-3 $frust-1 &> /dev/null; then
echo -e "\nSame output as Rust v1"
else
echo -e "\nDIFFERENT! First 10 lines of output differences for Rust-3:"
diff -y $frust-3 $frust-1 | head -n10
fi
echo ""
for compiler in $compilers; do
if which $compiler &> /dev/null; then
echo "==> $compiler <=="
{ time ./monte-carlo-$compiler $1 $2 $3 $fcpp-$compiler; } 2> mc/time-$compiler
if diff $fcpp-$compiler $frust-1 &> /dev/null; then
echo -e "\nSame output as Rust v1"
else
echo -e "\nDIFFERENT! First 10 lines of output differences for $compiler:"
diff -y $fcpp-$compiler $frust-1 | head -n10
fi
echo ""
fi
done
tail -n3 mc/time*