Skip to content

Commit 7778c51

Browse files
authored
Update run.sh
1 parent 4989f73 commit 7778c51

File tree

1 file changed

+31
-94
lines changed

1 file changed

+31
-94
lines changed

scripts/run.sh

Lines changed: 31 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -2,114 +2,51 @@
22

33
FILES_SEQ="build/bin/*_seq"
44
for file in $FILES_SEQ; do
5-
if [ "$file" = "build/bin/*_seq" ]
6-
then
7-
continue
8-
fi
9-
start_seq=`date +%s`
10-
echo "--------------------------------"
11-
echo $(basename $file)
12-
echo "--------------------------------"
13-
./$file --gtest_repeat=10
14-
end_seq=`date +%s`
15-
runtime=$((end_seq-start_seq))
16-
if [ "$runtime" -gt "5" ]
17-
then
18-
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
19-
exit 1
20-
fi
5+
echo "--------------------------------"
6+
echo $(basename $file)
7+
echo "--------------------------------"
8+
./$file --gtest_repeat=10
219
done
2210

23-
2411
FILES_OMP="build/bin/*_omp"
2512
for file in $FILES_OMP; do
26-
if [ "$file" = "build/bin/*_omp" ]
27-
then
28-
continue
29-
fi
30-
start_omp=`date +%s`
31-
echo "--------------------------------"
32-
echo $(basename $file)
33-
echo "--------------------------------"
34-
./$file --gtest_repeat=10
35-
end_omp=`date +%s`
36-
runtime=$((end_omp-start_omp))
37-
if [ "$runtime" -gt "5" ]
38-
then
39-
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
40-
exit 1
41-
fi
13+
echo "--------------------------------"
14+
echo $(basename $file)
15+
echo "--------------------------------"
16+
./$file --gtest_repeat=10
4217
done
4318

44-
4519
FILES_TBB="build/bin/*_tbb"
4620
for file in $FILES_TBB; do
47-
if [ "$file" = "build/bin/*_tbb" ]
48-
then
49-
continue
50-
fi
51-
start_tbb=`date +%s`
52-
echo "--------------------------------"
53-
echo $(basename $file)
54-
echo "--------------------------------"
55-
./$file --gtest_repeat=10
56-
end_tbb=`date +%s`
57-
runtime=$((end_tbb-start_tbb))
58-
if [ "$runtime" -gt "5" ]
59-
then
60-
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
61-
exit 1
62-
fi
21+
echo "--------------------------------"
22+
echo $(basename $file)
23+
echo "--------------------------------"
24+
./$file --gtest_repeat=10
6325
done
6426

65-
6627
FILES_STD="build/bin/*_std"
6728
for file in $FILES_STD; do
68-
if [ "$file" = "build/bin/*_std" ]
69-
then
70-
continue
71-
fi
72-
start_std=`date +%s`
73-
echo "--------------------------------"
74-
echo $(basename $file)
75-
echo "--------------------------------"
76-
./$file --gtest_repeat=10
77-
end_std=`date +%s`
78-
runtime=$((end_std-start_std))
79-
if [ "$runtime" -gt "5" ]
80-
then
81-
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
82-
exit 1
83-
fi
29+
echo "--------------------------------"
30+
echo $(basename $file)
31+
echo "--------------------------------"
32+
./$file --gtest_repeat=10
8433
done
8534

8635
FILES_MPI="build/bin/*_mpi"
8736
for file in $FILES_MPI; do
88-
if [ "$file" = "build/bin/*_mpi" ]
89-
then
90-
continue
91-
fi
92-
start_mpi=`date +%s`
93-
echo "--------------------------------"
94-
echo $(basename $file)
95-
echo "--------------------------------"
96-
if [[ $OSTYPE == 'linux' ]]; then
97-
NUM_PROC=$(cat /proc/cpuinfo|grep processor|wc -l)
98-
elif [[ $OSTYPE == 'osx' ]]; then
99-
NUM_PROC=$(sysctl -a | grep machdep.cpu | grep thread_count | cut -d ' ' -f 2)
100-
else
101-
echo "Unknown OS"
102-
NUM_PROC="1"
103-
fi
104-
echo "NUM_PROC: " $NUM_PROC
105-
for i in {1..10}; do
106-
mpirun -np $NUM_PROC $file || exit 1
107-
done
108-
end_mpi=`date +%s`
109-
runtime=$((end_mpi-start_mpi))
110-
if [ "$runtime" -gt "5" ]
111-
then
112-
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
113-
exit 1
114-
fi
37+
echo "--------------------------------"
38+
echo $(basename $file)
39+
echo "--------------------------------"
40+
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
41+
NUM_PROC=$(cat /proc/cpuinfo|grep processor|wc -l)
42+
elif [[ $TRAVIS_OS_NAME == 'osx' ]]; then
43+
NUM_PROC=$(sysctl -a | grep machdep.cpu | grep thread_count | cut -d ' ' -f 2)
44+
else
45+
echo "Unknown OS"
46+
NUM_PROC="1"
47+
fi
48+
echo "NUM_PROC: " $NUM_PROC
49+
for i in {1..10}; do
50+
mpirun -np $NUM_PROC $file || exit 1
51+
done
11552
done

0 commit comments

Comments
 (0)