Skip to content

Commit 102a4ca

Browse files
author
Alexander Nesterov
committed
Update time limit
1 parent a69c6c3 commit 102a4ca

File tree

1 file changed

+70
-38
lines changed

1 file changed

+70
-38
lines changed

scripts/run.sh

Lines changed: 70 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,75 @@
11
#!/bin/bash
2-
FILES_OMP="build/bin/*_omp"
3-
for file in $FILES_OMP; do
4-
echo "--------------------------------"
5-
echo $(basename $file)
6-
echo "--------------------------------"
7-
./$file --gtest_repeat=10
8-
done
2+
start_omp=`date +%s`
3+
FILES_OMP="build/bin/*_omp"
4+
for file in $FILES_OMP; do
5+
echo "--------------------------------"
6+
echo $(basename $file)
7+
echo "--------------------------------"
8+
./$file --gtest_repeat=10
9+
done
10+
end_omp=`date +%s`
11+
runtime=$((end_omp-start_omp))
12+
if [ "$runtime" -gt "5" ]
13+
then
14+
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
15+
exit 1
16+
fi
917

10-
FILES_TBB="build/bin/*_tbb"
11-
for file in $FILES_TBB; do
12-
echo "--------------------------------"
13-
echo $(basename $file)
14-
echo "--------------------------------"
15-
./$file --gtest_repeat=10
16-
done
18+
start_tbb=`date +%s`
19+
FILES_TBB="build/bin/*_tbb"
20+
for file in $FILES_TBB; do
21+
echo "--------------------------------"
22+
echo $(basename $file)
23+
echo "--------------------------------"
24+
./$file --gtest_repeat=10
25+
done
26+
end_tbb=`date +%s`
27+
runtime=$((end_tbb-start_tbb))
28+
if [ "$runtime" -gt "5" ]
29+
then
30+
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
31+
exit 1
32+
fi
1733

18-
FILES_STD="build/bin/*_std"
19-
for file in $FILES_STD; do
20-
echo "--------------------------------"
21-
echo $(basename $file)
22-
echo "--------------------------------"
23-
./$file --gtest_repeat=10
24-
done
34+
start_std=`date +%s`
35+
FILES_STD="build/bin/*_std"
36+
for file in $FILES_STD; do
37+
echo "--------------------------------"
38+
echo $(basename $file)
39+
echo "--------------------------------"
40+
./$file --gtest_repeat=10
41+
done
42+
end_std=`date +%s`
43+
runtime=$((end_std-start_std))
44+
if [ "$runtime" -gt "5" ]
45+
then
46+
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
47+
exit 1
48+
fi
2549

26-
FILES_MPI="build/bin/*_mpi"
27-
for file in $FILES_MPI; do
28-
echo "--------------------------------"
29-
echo $(basename $file)
30-
echo "--------------------------------"
31-
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
32-
NUM_PROC=$(cat /proc/cpuinfo|grep processor|wc -l)
33-
elif [[ $TRAVIS_OS_NAME == 'osx' ]]; then
34-
NUM_PROC=$(sysctl -a | grep machdep.cpu | grep thread_count | cut -d ' ' -f 2)
35-
else
36-
echo "Unknown OS"
37-
NUM_PROC="1"
38-
fi
39-
echo "NUM_PROC: " $NUM_PROC
40-
for i in {1..10}; do
41-
mpirun -np $NUM_PROC $file || exit 1
50+
start_mpi=`date +%s`
51+
FILES_MPI="build/bin/*_mpi"
52+
for file in $FILES_MPI; do
53+
echo "--------------------------------"
54+
echo $(basename $file)
55+
echo "--------------------------------"
56+
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
57+
NUM_PROC=$(cat /proc/cpuinfo|grep processor|wc -l)
58+
elif [[ $TRAVIS_OS_NAME == 'osx' ]]; then
59+
NUM_PROC=$(sysctl -a | grep machdep.cpu | grep thread_count | cut -d ' ' -f 2)
60+
else
61+
echo "Unknown OS"
62+
NUM_PROC="1"
63+
fi
64+
echo "NUM_PROC: " $NUM_PROC
65+
for i in {1..10}; do
66+
mpirun -np $NUM_PROC $file || exit 1
67+
done
4268
done
43-
done
69+
end_mpi=`date +%s`
70+
runtime=$((end_mpi-start_mpi))
71+
if [ "$runtime" -gt "5" ]
72+
then
73+
echo "Alert: runtime > 5 sec. runtime = $runtime sec."
74+
exit 1
75+
fi

0 commit comments

Comments
 (0)