-
Notifications
You must be signed in to change notification settings - Fork 2
/
test
executable file
·85 lines (62 loc) · 1.61 KB
/
test
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
dir_src=$PWD/Src
dir_test=$PWD/Tests
echo $dir_test
ls $dir_test
#-----------------#
# compile connect #
#-----------------#
dir_cur=$PWD
cd $dir_src
g++ -o con connect.cpp Global/global_name_file.cpp
cd $dir_cur
echo $dir_cur
#------------------------------#
# browse through all the tests #
#------------------------------#
for icase in $( ls $dir_test ); do
if [ $icase != "CVS" ]; then
# go to source directory
cd $dir_src
# compile in source directory
rm -f main.o
rm -f Boil
ln -s -f $dir_test/$icase/main-$icase.cpp main.cpp
make
# go to test directory and run
cd $dir_test/$icase
cp -f $dir_src/Boil .
rm -f out_?
rm -f md5.now
#----------------------------------#
# browse through processor numbers #
#----------------------------------#
for nproc in 1 2 4; do
mpirun -np $nproc ./Boil > out_$nproc
# extract what is important from out_? files
cat out_$nproc | grep residual > residual.$nproc
cat out_$nproc | grep Cycle > cycle.$nproc
# find md5 summs out of it
md5sum residual.$nproc >> md5.now
md5sum cycle.$nproc >> md5.now
done
# create a single result file
$dir_src/con test 4 0
# get its md5sum
md5sum test.gmv >> md5.now
# check if the results differ
diff md5.now md5.sum > diff.log
size=$(stat -c%s "diff.log")
if [ "$size" == "0" ]; then
touch OK
rm -f residual.*
rm -f cycle.*
rm -f md5.now
else
touch $dir_test/$icase.failed
fi
# remove the results, leaving test.gmv
rm -f *.gmv.*
fi
done
echo 'done !'