Skip to content
Snippets Groups Projects
Commit 22550824 authored by Anne Philipp's avatar Anne Philipp
Browse files

Merge branch 'dev' of https://www.flexpart.eu/git/flex_extract into dev

merged changes of Fortran testcases
parents 30f7911a 6bc4b425
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
# Copyright Petra Seibert, 2019
# SPDX-License-Identifier: MIT-0
export OMP_NUM_THREADS=4
export OMP_NUM_THREADS=4 # you may want to change this
export OMP_PLACES=sockets
testhome=`pwd`
path1=../../../Source/Fortran/
......@@ -20,6 +20,7 @@ rm -f log.run_ref failed
rm -f log.run_ref
if [ "$1" = omithigh ]; then # for fast testing, not for production
# requires > 16 GB
inputs=`ls Inputs | grep -v high`
else
inputs=`ls Inputs`
......
#!/bin/bash
# Do the regression tests
# can be called without arguments, then will test all cases
# or with argument "omithigh" then high-resolution cases are omitted
# Copyright Petra Seibert, 2019
# SPDX-License-Identifier: MIT-0
export OMP_NUM_THREADS=4 # you may want to change this
export OMP_PLACES=sockets
testhome=`pwd`
path1=../../../Source/Fortran/
path=../${path1}
exedebug=calc_etadot_debug.out
exefast=calc_etadot_fast.out
hash=$(git log --abbrev-commit --pretty=oneline -n 1 --pretty=format:'%h')
exitonfail=true
numtest=0
numpassed=0
rm -f log.run_regr failed
# loop over all reference runs
if [ "$1" = omithigh ]; then # for fast testing, not for production
inputs=`ls Inputs | grep -v high`
else
inputs=`ls Inputs |grep etadothigh`
fi
for ref in $inputs; do
echo 'Working on test case =' $ref
# loop over debug and fast runs
for exe in 'debug' 'fast'; do
numtest=$((numtest + 1))
failed=false
rm -f Work/* # make shure that Work is empty
cd Work
echo ' Run code version "'${exe}'"' | tee -a ../log.run_regr
thisexe=calc_etadot_${exe}.out
ln ../Inputs/${ref}/fort.* .
( time ${path}${thisexe} ) >& log
# check whether runs completeted properly
grep -q CONGRATULATIONS log
if [ $? = "0" ]; then
echo ' CONGRATULATIONS found' | tee -a ../log.run_regr
else
echo ' missing CONGRATULATIONS. Test failed.' | tee -a ../log.run_regr
echo $ref $exe 'FAILED' >> ${testhome}/failed
if [ "${exitonfail}" = true ]; then exit; else failed=true; fi
fi
for outfile in 'fort.15' 'VERTICAL.EC'; do
if [ -e $outfile ]; then
# compare reference and current version
# omega case also produces fort.25 - need to add this
outref='../Outputs/Output_ref_'${ref}'_'${exe}'/'$outfile
test=$(cmp $outfile $outref)
if $test; then
echo ' '$outfile ' test passed' | tee -a ../log.run_regr
else
echo 'WARNING:' $outfile ' test failed' | tee -a ../log.run_regr
echo $ref $exe 'FAILED' >> ${testhome}/failed
if [ "${exitonfail}" = true ]; then exit; else failed=true; fi
fi
else
echo ' missing '${outfile}' Test failed.' | tee -a ../log.run_regr
echo $ref $exe 'FAILED' >> ${testhome}/failed
if [ "${exitonfail}" = true ]; then exit; else failed=true; fi
fi
done # end loop outfiles
if [ "${failed}" = false ]; then numpassed=$((numpassed + 1)); fi
# save and show runtimes
log='log'
times=$(tail -3 ${log})
real=$(echo $times | grep real | awk '{print $2}')
user=$(echo $times | grep user | awk '{print $4}')
sys=$( echo $times | grep sys | awk '{print $6}')
echo $hash, "'"reference"'", "'"${ref}'_'${exe}"'", ${real}, ${user}, ${sys} >> ../runtimes.csv
tail -1 ../runtimes.csv >> log.run_regr
cd ..
rm Work/* # this is for being more safe
done # end of exe loop
echo # go to next reference run
done # end of ref loop
echo
echo ' Regression test: ' $numpassed 'out of' $numtest 'tests passed'. \
| tee -a ../log.run_regr
echo ' More information may be found in log.run_regr'
echo ' Runtimes were added to runtimes.csv under '$hash | tee -a ../log.run_regr
# the following code is executed only if exitonfail is not set to 'true'.
if [ -e failed ]; then
echo
echo Some tests failed, see file "failed":
echo
cat failed|sort -u
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment