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="146.0091" # - 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.7321" # - 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.58411" # 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="9.4385" # 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]}
66 ./matplotlib_plot.py $file_stat
67 echo "<DartMeasurementFile name=\"Energy $1\" type=\"image/png\">`pwd`/${file_stat}_ene.png</DartMeasurementFile>"
69 if [ `echo "a=${array[0]}-${refe};if(0>a)a*=-1;a>6.0"|bc -l` != "0" ]; then
70 echo 'difference ' `echo "a=${array[0]}-${refe};if(0>a)a*=-1;a"|bc -l` "from reference ave etot ${refe} greater than 6.0"
72 elif [ `echo "a=${array[1]};a>0.40"|bc -l` != "0" ]; then
73 echo 'standard deviation greater than 0.40'
78 elif [ "$1" == "1L2Y_L" ] || [ "$1" == "1L2Y_NH" ]; then
79 if [ ! -s $file_stat ]; then
80 echo 'FATAL error - stat file empty'
83 chi2=`./matplotlib_fit_hist.py $file_stat 111`
84 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
85 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
87 if [ `echo "a=${chi2};a>0.001"|bc -l` != "0" ]; then
88 echo 'chi2 greater than 0.001'
93 elif [ "$1" == "1L2Y_B" ]; then
94 if [ ! -s $file_stat ]; then
95 echo 'FATAL error - stat file empty'
98 chi2=`./matplotlib_fit_hist.py $file_stat 111`
99 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
100 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
102 if [ `echo "a=${chi2};a>0.01"|bc -l` != "0" ]; then
103 echo 'chi2 greater than 0.01'
110 elif [ "$1" == "1L2Y_remd" ]; then
112 tail -q -n +1000 1L2Y_remd*.stat >remd_all.stat
113 if [ ! -s remd_all.stat ]; then
114 echo 'FATAL error - stat files empty'
119 echo "<DartMeasurementFile name=\"Histograms $1\" type=\"image/png\">`pwd`/1L2Y_remd_ene_hist.png</DartMeasurementFile>"
120 echo "<DartMeasurementFile name=\"Energy $1\" type=\"image/png\">`pwd`/1L2Y_remd_Tene.png</DartMeasurementFile>"
121 grep ACC 1L2Y_remd.out_GB000 |tail -7
122 exchange=`grep ACC 1L2Y_remd.out_GB000 |tail -7|awk '{a=a+$4}END{print a/NR}'`
123 echo "average exchange = ${exchange}"
124 if [ `echo "a=${exchange};a<0.2"|bc -l` != "0" ]; then
125 echo 'ERROR average exchange smaller than 0.2'
131 elif [ "$1" == "1DKZcut-ber" ]; then
132 chi2=`./matplotlib_fit_hist.py $file_stat 519`
133 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
134 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
136 if [ `echo "a=${chi2};a>0.01"|bc -l` != "0" ]; then
137 echo 'chi2 greater than 0.01'
143 elif [ "$1" == "1DKZcut-lang" ]; then
144 chi2=`./matplotlib_fit_hist.py $file_stat 519`
145 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
146 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
148 if [ `echo "a=${chi2};a>0.001"|bc -l` != "0" ]; then
149 echo 'chi2 greater than 0.001'
155 elif [ "$1" == "1DKZcut-min" ]; then
156 extremediff="10.0" # extreme energy difference, comething went terribly wrong
157 expectenergy="323.6931" # - expected total energy
158 cutoffdiff="8.0" # energy cutoff variation - more then this rises warning
160 sumsl_return=`grep SUMSL $file|awk '{print $4}'`
161 echo 'SUMSL return code' $sumsl_return
162 if [ "$sumsl_return" != "4" ]; then
163 echo 'ERROR = SUMSL return code' $sumsl_return 'is not 4'
164 echo 'but not failing this test, it is known problem with esccor'
168 elif [ "$1" == "1DKZcut-ene" ]; then
169 extremediff="10000.0" # extreme energy difference, comething went terribly wrong
170 expectenergy="-443.2674" # - expected total energy
171 cutoffdiff="0.01" # energy cutoff variation - more then this rises warning
173 elif [ "$1" == "1DKZcut-micro" ]; then
175 stat=`awk '{if ( $1 != "#" ) {n++;a=a+$5;a2=a2+$5^2}}END{print a/n,sqrt((a2-a^2/n)/n)}' $file_stat`
177 echo 'average total energy ' ${array[0]}
178 echo 'standard deviation ' ${array[1]}
179 if [ `echo "a=${array[0]}-(${refe});if(0>a)a*=-1;a>5.0"|bc -l` != "0" ]; then
180 echo 'difference ' `echo "a=${array[0]}-${refe};if(0>a)a*=-1;a"|bc -l` "from reference ave etot ${refe} greater than 5.0"
182 elif [ `echo "a=${array[1]};a>0.005"|bc -l` != "0" ]; then
183 echo 'standard deviation greater than 0.005'
189 elif [ "$1" == "1ei0_min" ]; then
190 extremediff="20.0" # extreme energy difference, comething went terribly wrong
191 expectenergy="148.5862" # - expected total energy
192 cutoffdiff="10.0" # energy cutoff variation - more then this rises warning
195 startene=`grep ETOT $file|head -1| awk '{print $2*1.0}'`
196 echo "initial energy=${startene} reference=${refe}"
197 if [ `echo "a=${startene}-(${refe});if(0>a)a*=-1;a>0.01"|bc -l` != "0" ]; then
198 echo 'difference ' `echo "a=${startene}-${refe};if(0>a)a*=-1;a"|bc -l` "from reference etot ${refe} greater than 0.01"
202 sumsl_return=`grep SUMSL $file|awk '{print $4}'`
203 echo 'SUMSL return code' $sumsl_return
204 if [ "$sumsl_return" != "4" ]; then
205 echo 'ERROR = SUMSL return code' $sumsl_return 'is not 4'
206 echo 'but not failing this test, it is known problem with dissulfides'
210 elif [ "$1" == "prota_CHECKGRAD" ] || [ "$1" == "1DKZcut-checkgrad" ] || [ "$1" == "checkgrad_dfa" ] ; then
211 diff=`gawk -f checkgrad.awk $file |grep 'Largest abs(1-numerical/analytical)='|awk '{printf "%15.10f",$3}'`
212 gawk -f checkgrad.awk $file
214 if [ `echo "a=${diff};a>0.025"|bc -l` != "0" ]; then
215 echo 'ERROR largest abs(1-numerical/analytical)' ${diff}
216 echo ' greater than 0.025'
222 elif [ "$1" == "Ts866_checkgrad_full" ] ; then
223 diff=`gawk -f checkgrad.awk $file |grep 'Largest abs(1-numerical/analytical)='|awk '{printf "%15.10f",$3}'`
224 gawk -f checkgrad.awk $file
227 ene=`grep ETOT $file|head -1| awk '{print $2*1.0}'`
228 hene=`grep H_CONS $file|head -1| awk '{print $2*1.0}'`
233 echo "ETOT= " ${ene} " reference= " ${ene_ref}
234 if [ `echo "a=${ene}-(${ene_ref});if(0>a)a*=-1;a>0.01"|bc -l` != "0" ]; then
235 echo 'difference ' `echo "a=${ene}-${ene_ref};if(0>a)a*=-1;a"|bc -l` "from reference etot ${ene_ref} greater than 0.01"
239 echo "H_CONS= " ${hene} " reference= " ${hene_ref}
240 if [ `echo "a=${hene}-(${hene_ref});if(0>a)a*=-1;a>0.01"|bc -l` != "0" ]; then
241 echo 'difference ' `echo "a=${hene}-${hene_ref};if(0>a)a*=-1;a"|bc -l` "from reference etot ${hene_ref} greater than 0.01"
246 if [ `echo "a=${diff};a>0.0080"|bc -l` != "0" ]; then
247 echo 'ERROR largest abs(1-numerical/analytical)' ${diff}
248 echo ' greater than 0.0080'
252 if [ "${exit_error}" == "1" ]; then
259 elif [ "$1" == "remd_dfa" ]; then
261 tail -q -n +100 remd_dfa*.stat >remd_all.stat
262 if [ ! -s remd_all.stat ]; then
263 echo 'FATAL error - stat files empty'
268 echo "<DartMeasurementFile name=\"Histograms $1\" type=\"image/png\">`pwd`/1L2Y_remd_ene_hist.png</DartMeasurementFile>"
269 echo "<DartMeasurementFile name=\"Energy $1\" type=\"image/png\">`pwd`/1L2Y_remd_Tene.png</DartMeasurementFile>"
270 grep ACC remd_dfa.out_GB000 |tail -7
271 exchange=`grep ACC remd_dfa.out_GB000 |tail -7|awk '{a=a+$4}END{print a/NR}'`
272 echo "average exchange = ${exchange}"
273 if [ `echo "a=${exchange};a<0.1"|bc -l` != "0" ]; then
274 echo 'ERROR average exchange smaller than 0.1'
288 echo $1 | sed -e 's/[eE]+/*10^/'
291 #---------------------------------------------------------------------------
293 #---------------------------------------------------------------------------
295 # Check if file exist
296 if [ ! -f $file ]; then
297 echo "CRITICAL: out file do not exist"
301 # Check if energy value is not a number
302 grepene=`grep ETOT $file|tail -1| awk '{print $2}'`
303 if [[ $grepene == "NaN" ]]; then
304 echo "CRITICAL: energy is NaN"
308 # Check if energy value is extremely different from expected
309 #blaene=`floating $grepene`
310 #myene=`echo $blaene |bc`
311 #diff=`echo $myene"+("$expectenergy")"|bc`
312 #absdiff=`echo $diff| sed 's/-//'`
313 absdiff=`awk "function abs(v) {return v < 0 ? -v : v}BEGIN{print $grepene+$expectenergy}"`
315 true1=`echo "$absdiff >= $extremediff"|bc`
316 if [ $true1 -eq 1 ]; then
317 echo "CRITICAL: energy is loo large $absdiff, ene= $myene"
321 # Check if Energy value is as expected
322 true2=`echo "$absdiff<=$cutoffdiff"|bc`
323 if [ $true2 -eq 1 ]; then
324 echo "OK: absdiff= $absdiff, ene= $myene"
327 echo "WARNING: energy is somewhat different $absdiff, ene= $myene"