3 # Writen by Dawid Jagieła and Adam Sieradzan
4 # and Cezary Czaplewski
7 #----------------------------------------
10 if [[ "$2" =~ "MPI" ]]; then
12 file_stat=$1_GB000.stat
14 file=$1.out_GB # Output file to search energy value from
18 if [ "$1" == "prota_ENE_m" ]; then
19 extremediff="10000.0" # extreme energy difference, comething went terribly wrong
20 expectenergy="145.1742" # - expected total energy
21 cutoffdiff="0.01" # energy cutoff variation - more then this rises warning
22 elif [ "$1" == "prota_MIN_CART" ]; then
23 extremediff="10.0" # extreme energy difference, comething went terribly wrong
24 expectenergy="158.3680" # - expected total energy
25 cutoffdiff="0.1" # energy cutoff variation - more then this rises warning
27 sumsl_return=`grep SUMSL $file|awk '{print $4}'`
28 echo 'SUMSL return code' $sumsl_return
29 if [ "$sumsl_return" != "4" ]; then
30 echo 'ERROR = SUMSL return code' $sumsl_return 'is not 4'
33 elif [ "$1" == "1l2y_MIN_INT" ]; then
34 extremediff="10.0" # extreme energy difference, comething went terribly wrong
35 expectenergy="-47.88137" # expected total energy
36 cutoffdiff="0.1" # energy cutoff variation - more then this rises warning
38 sumsl_return=`grep SUMSL $file|awk '{print $4}'`
39 echo 'SUMSL return code' $sumsl_return
40 if [ "$sumsl_return" != "4" ]; then
41 echo 'ERROR = SUMSL return code' $sumsl_return 'is not 4'
44 elif [ "$1" == "1l2y_MIN_REGULAR_INT" ]; then
45 extremediff="10.0" # extreme energy difference, comething went terribly wrong
46 expectenergy="47.55" # expected total energy
48 # something wrong with REGULAR and sometimes gives code 8 and different energy
49 # for now 8 is only warning and cutoffdiff is large
51 cutoffdiff="6.0" # energy cutoff variation - more then this rises warning
53 sumsl_return=`grep "SUMSL return code:" $file|awk '{print $4}'`
54 echo 'SUMSL return code' $sumsl_return
55 if [ "$sumsl_return" != "4" ]; then
56 echo 'WARNING = SUMSL return code' $sumsl_return 'is not 4'
59 elif [ "$1" == "1l2y_micro" ]; then
61 stat=`awk '{if ( $1 != "#" ) {n++;a=a+$5;a2=a2+$5^2}}END{print a/n,sqrt((a2-a^2/n)/n)}' $file_stat`
63 echo 'average total energy ' ${array[0]}
64 echo 'standard deviation ' ${array[1]}
65 if [ `echo "a=${array[0]}-${refe};if(0>a)a*=-1;a>5.0"|bc -l` != "0" ]; then
66 echo 'difference ' `echo "a=${array[0]}-${refe};if(0>a)a*=-1;a"|bc -l` "from reference ave etot ${refe} greater than 5.0"
68 elif [ `echo "a=${array[1]};a>0.15"|bc -l` != "0" ]; then
69 echo 'standard deviation greater than 0.15'
74 elif [ "$1" == "1L2Y_L" ] || [ "$1" == "1L2Y_NH" ]; then
75 if [ ! -s $file_stat ]; then
76 echo 'FATAL error - stat file empty'
79 chi2=`./matplotlib_fit_hist.py $file_stat 111`
80 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
81 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
83 if [ `echo "a=${chi2};a>0.001"|bc -l` != "0" ]; then
84 echo 'chi2 greater than 0.001'
89 elif [ "$1" == "1L2Y_B" ]; then
90 if [ ! -s $file_stat ]; then
91 echo 'FATAL error - stat file empty'
94 chi2=`./matplotlib_fit_hist.py $file_stat 111`
95 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
96 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
98 if [ `echo "a=${chi2};a>0.01"|bc -l` != "0" ]; then
99 echo 'chi2 greater than 0.01'
106 elif [ "$1" == "1L2Y_remd" ]; then
108 tail -q -n +1000 1L2Y_remd*.stat >remd_all.stat
109 if [ ! -s remd_all.stat ]; then
110 echo 'FATAL error - stat files empty'
115 echo "<DartMeasurementFile name=\"Histograms $1\" type=\"image/png\">`pwd`/1L2Y_remd_ene_hist.png</DartMeasurementFile>"
116 echo "<DartMeasurementFile name=\"Energy $1\" type=\"image/png\">`pwd`/1L2Y_remd_Tene.png</DartMeasurementFile>"
117 grep ACC 1L2Y_remd.out_GB000 |tail -7
118 exchange=`grep ACC 1L2Y_remd.out_GB000 |tail -7|awk '{a=a+$4}END{print a/NR}'`
119 echo "average exchange = ${exchange}"
120 if [ `echo "a=${exchange};a<0.2"|bc -l` != "0" ]; then
121 echo 'ERROR average exchange smaller than 0.2'
127 elif [ "$1" == "1DKZcut-ber" ]; then
128 chi2=`./matplotlib_fit_hist.py $file_stat 519`
129 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
130 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
132 if [ `echo "a=${chi2};a>0.01"|bc -l` != "0" ]; then
133 echo 'chi2 greater than 0.01'
139 elif [ "$1" == "1DKZcut-lang" ]; then
140 chi2=`./matplotlib_fit_hist.py $file_stat 519`
141 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
142 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
144 if [ `echo "a=${chi2};a>0.001"|bc -l` != "0" ]; then
145 echo 'chi2 greater than 0.001'
151 elif [ "$1" == "1DKZcut-min" ]; then
152 extremediff="10.0" # extreme energy difference, comething went terribly wrong
153 expectenergy="332.1213" # - expected total energy
154 cutoffdiff="3.0" # energy cutoff variation - more then this rises warning
156 sumsl_return=`grep SUMSL $file|awk '{print $4}'`
157 echo 'SUMSL return code' $sumsl_return
158 if [ "$sumsl_return" != "4" ]; then
159 echo 'ERROR = SUMSL return code' $sumsl_return 'is not 4'
160 echo 'but not failing this test, it is known problem with esccor'
164 elif [ "$1" == "1DKZcut-ene" ]; then
165 extremediff="10000.0" # extreme energy difference, comething went terribly wrong
166 expectenergy="-452.4430" # - expected total energy
167 cutoffdiff="0.01" # energy cutoff variation - more then this rises warning
169 elif [ "$1" == "1DKZcut-micro" ]; then
171 stat=`awk '{if ( $1 != "#" ) {n++;a=a+$5;a2=a2+$5^2}}END{print a/n,sqrt((a2-a^2/n)/n)}' $file_stat`
173 echo 'average total energy ' ${array[0]}
174 echo 'standard deviation ' ${array[1]}
175 if [ `echo "a=${array[0]}-(${refe});if(0>a)a*=-1;a>5.0"|bc -l` != "0" ]; then
176 echo 'difference ' `echo "a=${array[0]}-${refe};if(0>a)a*=-1;a"|bc -l` "from reference ave etot ${refe} greater than 5.0"
178 elif [ `echo "a=${array[1]};a>0.005"|bc -l` != "0" ]; then
179 echo 'standard deviation greater than 0.005'
185 elif [ "$1" == "1ei0_min" ]; then
186 extremediff="10.0" # extreme energy difference, comething went terribly wrong
187 expectenergy="151.3218" # - expected total energy
188 cutoffdiff="6.0" # energy cutoff variation - more then this rises warning
191 startene=`grep ETOT $file|head -1| awk '{print $2*1.0}'`
192 echo "initial energy=${startene} reference=${refe}"
193 if [ `echo "a=${startene}-(${refe});if(0>a)a*=-1;a>0.01"|bc -l` != "0" ]; then
194 echo 'difference ' `echo "a=${startene}-${refe};if(0>a)a*=-1;a"|bc -l` "from reference etot ${refe} greater than 0.01"
198 sumsl_return=`grep SUMSL $file|awk '{print $4}'`
199 echo 'SUMSL return code' $sumsl_return
200 if [ "$sumsl_return" != "4" ]; then
201 echo 'ERROR = SUMSL return code' $sumsl_return 'is not 4'
202 echo 'but not failing this test, it is known problem with dissulfides'
206 elif [ "$1" == "prota_CHECKGRAD" ] || [ "$1" == "1DKZcut-checkgrad" ] || [ "$1" == "checkgrad_dfa" ] ; then
207 diff=`gawk -f checkgrad.awk $file |grep 'Largest abs(1-numerical/analytical)='|awk '{printf "%15.10f",$3}'`
208 gawk -f checkgrad.awk $file
210 if [ `echo "a=${diff};a>0.0003"|bc -l` != "0" ]; then
211 echo 'ERROR largest abs(1-numerical/analytical)' ${diff}
212 echo ' greater than 0.0005'
218 elif [ "$1" == "Ts866_checkgrad_full" ] ; then
219 diff=`gawk -f checkgrad.awk $file |grep 'Largest abs(1-numerical/analytical)='|awk '{printf "%15.10f",$3}'`
220 gawk -f checkgrad.awk $file
223 ene=`grep ETOT $file|head -1| awk '{print $2*1.0}'`
224 hene=`grep H_CONS $file|head -1| awk '{print $2*1.0}'`
229 echo "ETOT= " ${ene} " reference= " ${ene_ref}
230 if [ `echo "a=${ene}-(${ene_ref});if(0>a)a*=-1;a>0.01"|bc -l` != "0" ]; then
231 echo 'difference ' `echo "a=${ene}-${ene_ref};if(0>a)a*=-1;a"|bc -l` "from reference etot ${ene_ref} greater than 0.01"
235 echo "H_CONS= " ${hene} " reference= " ${hene_ref}
236 if [ `echo "a=${hene}-(${hene_ref});if(0>a)a*=-1;a>0.01"|bc -l` != "0" ]; then
237 echo 'difference ' `echo "a=${hene}-${hene_ref};if(0>a)a*=-1;a"|bc -l` "from reference etot ${hene_ref} greater than 0.01"
242 if [ `echo "a=${diff};a>0.0020"|bc -l` != "0" ]; then
243 echo 'ERROR largest abs(1-numerical/analytical)' ${diff}
244 echo ' greater than 0.0020'
248 if [ "${exit_error}" == "1" ]; then
255 elif [ "$1" == "remd_dfa" ]; then
257 tail -q -n +100 remd_dfa*.stat >remd_all.stat
258 if [ ! -s remd_all.stat ]; then
259 echo 'FATAL error - stat files empty'
264 echo "<DartMeasurementFile name=\"Histograms $1\" type=\"image/png\">`pwd`/1L2Y_remd_ene_hist.png</DartMeasurementFile>"
265 echo "<DartMeasurementFile name=\"Energy $1\" type=\"image/png\">`pwd`/1L2Y_remd_Tene.png</DartMeasurementFile>"
266 grep ACC remd_dfa.out_GB000 |tail -7
267 exchange=`grep ACC remd_dfa.out_GB000 |tail -7|awk '{a=a+$4}END{print a/NR}'`
268 echo "average exchange = ${exchange}"
269 if [ `echo "a=${exchange};a<0.1"|bc -l` != "0" ]; then
270 echo 'ERROR average exchange smaller than 0.1'
284 echo $1 | sed -e 's/[eE]+/*10^/'
287 #---------------------------------------------------------------------------
289 #---------------------------------------------------------------------------
291 # Check if file exist
292 if [ ! -f $file ]; then
293 echo "CRITICAL: out file do not exist"
297 # Check if energy value is not a number
298 grepene=`grep ETOT $file|tail -1| awk '{print $2}'`
299 if [[ $grepene == "NaN" ]]; then
300 echo "CRITICAL: energy is NaN"
304 # Check if energy value is extremely different from expected
305 blaene=`floating $grepene`
306 myene=`echo $blaene |bc`
307 diff=`echo $myene"+("$expectenergy")"|bc`
308 absdiff=`echo $diff| sed 's/-//'`
310 true1=`echo "$absdiff >= $extremediff"|bc`
311 if [ $true1 -eq 1 ]; then
312 echo "CRITICAL: energy is loo large $absdiff, ene= $myene"
316 # Check if Energy value is as expected
317 true2=`echo "$absdiff<=$cutoffdiff"|bc`
318 if [ $true2 -eq 1 ]; then
319 echo "OK: absdiff= $absdiff, ene= $myene"
322 echo "WARNING: energy is somewhat different $absdiff, ene= $myene"