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" ]; 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="154.9622" # - 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="5.258893" # 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.1"|bc -l` != "0" ]; then
69 echo 'standard deviation greater than 0.1'
74 elif [ "$1" == "1L2Y_L" ] || [ "$1" == "1L2Y_NH" ]; then
75 chi2=`./matplotlib_fit_hist.py $file_stat 111`
76 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
77 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
79 if [ `echo "a=${chi2};a>0.001"|bc -l` != "0" ]; then
80 echo 'chi2 greater than 0.001'
85 elif [ "$1" == "1L2Y_B" ]; then
86 chi2=`./matplotlib_fit_hist.py $file_stat 111`
87 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
88 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
90 if [ `echo "a=${chi2};a>0.01"|bc -l` != "0" ]; then
91 echo 'chi2 greater than 0.01'
98 elif [ "$1" == "1L2Y_remd" ]; then
100 tail -q -n +1000 1L2Y_remd*.stat >remd_all.stat
103 echo "<DartMeasurementFile name=\"Histograms $1\" type=\"image/png\">`pwd`/1L2Y_remd_ene_hist.png</DartMeasurementFile>"
104 echo "<DartMeasurementFile name=\"Energy $1\" type=\"image/png\">`pwd`/1L2Y_remd_Tene.png</DartMeasurementFile>"
105 grep ACC 1L2Y_remd.out_GB000 |tail -7
106 exchange=`grep ACC 1L2Y_remd.out_GB000 |tail -7|awk '{a=a+$4}END{print a/NR}'`
107 echo "average exchange = ${exchange}"
108 if [ `echo "a=${exchange};a<0.2"|bc -l` != "0" ]; then
109 echo 'ERROR average exchange smaller than 0.2'
115 elif [ "$1" == "1DKZcut-ber" ]; then
116 chi2=`./matplotlib_fit_hist.py $file_stat 519`
117 echo 'Chi2 for fitting theoretical temperature distribution ' ${chi2}
118 echo "<DartMeasurementFile name=\"Temperature distribution $1\" type=\"image/png\">`pwd`/${file_stat}.png</DartMeasurementFile>"
120 if [ `echo "a=${chi2};a>0.01"|bc -l` != "0" ]; then
121 echo 'chi2 greater than 0.01'
127 elif [ "$1" == "1DKZcut-lang" ]; 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.001"|bc -l` != "0" ]; then
133 echo 'chi2 greater than 0.001'
139 elif [ "$1" == "1DKZcut-min" ]; then
140 extremediff="10.0" # extreme energy difference, comething went terribly wrong
141 expectenergy="332.1213" # - expected total energy
142 cutoffdiff="3.0" # energy cutoff variation - more then this rises warning
144 sumsl_return=`grep SUMSL $file|awk '{print $4}'`
145 echo 'SUMSL return code' $sumsl_return
146 if [ "$sumsl_return" != "4" ]; then
147 echo 'ERROR = SUMSL return code' $sumsl_return 'is not 4'
148 echo 'but not failing this test, it is known problem with esccor'
152 elif [ "$1" == "1DKZcut-ene" ]; then
153 extremediff="10000.0" # extreme energy difference, comething went terribly wrong
154 expectenergy="-452.4430" # - expected total energy
155 cutoffdiff="0.01" # energy cutoff variation - more then this rises warning
157 elif [ "$1" == "1DKZcut-micro" ]; then
159 stat=`awk '{if ( $1 != "#" ) {n++;a=a+$5;a2=a2+$5^2}}END{print a/n,sqrt((a2-a^2/n)/n)}' $file_stat`
161 echo 'average total energy ' ${array[0]}
162 echo 'standard deviation ' ${array[1]}
163 if [ `echo "a=${array[0]}-(${refe});if(0>a)a*=-1;a>5.0"|bc -l` != "0" ]; then
164 echo 'difference ' `echo "a=${array[0]}-${refe};if(0>a)a*=-1;a"|bc -l` "from reference ave etot ${refe} greater than 5.0"
166 elif [ `echo "a=${array[1]};a>0.005"|bc -l` != "0" ]; then
167 echo 'standard deviation greater than 0.005'
173 elif [ "$1" == "1ei0_min" ]; then
174 extremediff="10.0" # extreme energy difference, comething went terribly wrong
175 expectenergy="151.3218" # - expected total energy
176 cutoffdiff="5.0" # energy cutoff variation - more then this rises warning
179 startene=`grep ETOT $file|head -1| awk '{print $2*1.0}'`
180 echo "initial energy=${startene} reference=${refe}"
181 if [ `echo "a=${startene}-(${refe});if(0>a)a*=-1;a>0.01"|bc -l` != "0" ]; then
182 echo 'difference ' `echo "a=${startene}-${refe};if(0>a)a*=-1;a"|bc -l` "from reference etot ${refe} greater than 0.01"
186 sumsl_return=`grep SUMSL $file|awk '{print $4}'`
187 echo 'SUMSL return code' $sumsl_return
188 if [ "$sumsl_return" != "4" ]; then
189 echo 'ERROR = SUMSL return code' $sumsl_return 'is not 4'
190 echo 'but not failing this test, it is known problem with dissulfides'
202 echo $1 | sed -e 's/[eE]+/*10^/'
205 #---------------------------------------------------------------------------
207 #---------------------------------------------------------------------------
209 # Check if file exist
210 if [ ! -f $file ]; then
211 echo "CRITICAL: out file do not exist"
215 # Check if energy value is not a number
216 grepene=`grep ETOT $file|tail -1| awk '{print $2}'`
217 if [[ $grepene == "NaN" ]]; then
218 echo "CRITICAL: energy is NaN"
222 # Check if energy value is extremely different from expected
223 blaene=`floating $grepene`
224 myene=`echo $blaene |bc`
225 diff=`echo $myene"+("$expectenergy")"|bc`
226 absdiff=`echo $diff| sed 's/-//'`
228 true1=`echo "$absdiff >= $extremediff"|bc`
229 if [ $true1 -eq 1 ]; then
230 echo "CRITICAL: energy is loo large $absdiff, ene= $myene"
234 # Check if Energy value is as expected
235 true2=`echo "$absdiff<=$cutoffdiff"|bc`
236 if [ $true2 -eq 1 ]; then
237 echo "OK: absdiff= $absdiff, ene= $myene"
240 echo "WARNING: energy is somewhat different $absdiff, ene= $myene"