Skip to content
Snippets Groups Projects
Commit cfffa117 authored by jourdain's avatar jourdain
Browse files

Add tests ton fail the test in case of failure

parent d09bcb50
No related branches found
No related tags found
No related merge requests found
......@@ -13,12 +13,18 @@ operations_in_node_elimination_good=63980000000000
operations_in_node_elimination=$(printf -- "%.25g" `grep 'Operations in node elimination' $file | sort -u | awk '{print $7}' | tr 'D' 'E'`)
echo $operations_in_node_elimination_good $operations_in_node_elimination $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR Operations in node elimination differs more than "$3; else print "OK accurate Operations in node elimination"}'
echo $operations_in_node_elimination_good $operations_in_node_elimination $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR Operations in node elimination differs more than "$3; else print "OK accurate Operations in node elimination"}'
echo $operations_in_node_elimination_good $operations_in_node_elimination $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR Operations in node elimination differs more than "$3; else print "OK accurate Operations in node elimination"}' >> exitornot
max_allowed_diff=0.0
flops_difference_good=0.0
flops_difference=$(printf -- "%.25g" `grep "FLOPS_REFERENCE DIFFERENCE" results-mumps-charge/output_*.log | awk '{print $4}' | sort -u | sort -n -k1 | tail -n 1`)
echo $flops_difference_good $flops_difference $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR flops differs more than "$3; else print "OK accurate flops"}'
message=`echo $flops_difference_good $flops_difference $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR flops differs more than "$3; else print "OK accurate flops"}'`
echo $flops_difference_good $flops_difference $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR flops differs more than "$3; else print "OK accurate flops"}' >> exitornot
# linked to set -e, if the grep doesn't work, the script will fail
grep "OK accurate Operations in node elimination" exitornot
grep "OK accurate flops" exitornot
rm exitornot
grep "BENCH: TIME" $file | grep "simultaneous instances" | awk -F= '{print $2" instances time"$3}'
......@@ -14,10 +14,17 @@ operations_in_node_elimination_good=63980000000000
operations_in_node_elimination=$(printf -- "%.25g" `grep 'Operations in node elimination' $file | sort -u | awk '{print $7}' | tr 'D' 'E'`)
echo $operations_in_node_elimination_good $operations_in_node_elimination $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR Operations in node elimination differs more than "$3; else print "OK accurate Operations in node elimination"}'
echo $operations_in_node_elimination_good $operations_in_node_elimination $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR Operations in node elimination differs more than "$3; else print "OK accurate Operations in node elimination"}' >> exitornot
max_allowed_diff=0.0
flops_difference_good=0.0
flops_difference=$(printf -- "%.25g" `grep "FLOPS_REFERENCE DIFFERENCE" results-mumps-scale/output_*.log | awk '{print $4}' | sort -u | sort -n -k1 | tail -n 1`)
echo $flops_difference_good $flops_difference $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR flops differs more than "$3; else print "OK accurate flops"}'
echo $flops_difference_good $flops_difference $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR flops differs more than "$3; else print "OK accurate flops"}' >> exitornot
# linked to set -e, if the grep doesn't work, the script will fail
grep "OK accurate Operations in node elimination" exitornot
grep "OK accurate flops" exitornot
rm exitornot
grep "BENCH: TIME" $file | grep "simultaneous instances" | awk -F= '{print $2" instances time"$3}'
......@@ -4,19 +4,18 @@ set -x
mkdir -p results-vasp
cp -a OUTCAR* results-vasp/
max_allowed_diff=00000.0001
free_energy_good=-2139.27098853
grep free energy OUTCAR | tail -n1 > filetail
file=filetail
free_energy=$(grep 'free energy TOTEN' filetail| awk {'print $6'})
echo $free_energy
echo $free_energy_good $free_energy $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR free energyTOTEN differs more than "$3; else print "OK accurate Total energy"}'
echo $free_energy_good $free_energy $max_allowed_diff| awk '{if (sqrt(($1 - $2)^2) > $3) print "ERROR free energyTOTEN differs more than "$3; else print "OK accurate Total energy"}' >> exitornot
# linked to set -e, if the grep doesn't work, the script will fail
grep "OK accurate Total energy" exitornot
rm exitornot
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment