quantum-espresso/examples/daily_test

148 lines
3.7 KiB
Bash
Executable File

#!/bin/sh
# cp does not write the restart file to outdir but to the current directory.
# All other restart files are either written to outdir and cleaned by this
# script or ignored, but if this is found the code will restart from last run
/bin/rm -r /scr/giannozz/espresso/examples/example28/results/metadyn-cp_50.save/
# In order to use this script, you must be logged to anonymous cvs:
# $ cvs login
# (password: cvsanon)
# choose a directory ROOT in which to perform the test
# the code is in PWROOT=$ROOT/espresso
# temporary files in TMPDIR=$ROOT/tmp
ROOT=/scr/giannozz
MAILTO=p.giannozzi@sns.it
# choose setting for the compiler you want to use
. /opt/intel_fc_80/bin/ifortvars.sh
# for g95 + MKL:
# export CONFIG_OPTS="--disable-parallel F90=g95"
# for ifort:
. /opt/intel_fc_80/bin/ifortvars.sh
export CONFIG_OPTS="--disable-parallel"
#
# choose if you want to update an existing cvs (update=1)
# or to download a new one (update=0)
update=1
######################################################################
export CVSROOT=:pserver:cvsanon@democritos.sissa.it:/home/cvs
PWROOT=$ROOT/espresso
TMPDIR=$ROOT/tmp
OUT=$PWROOT/daily.out
/bin/rm $OUT
touch $OUT
if ! test -d $PWROOT; then
mkdir -p $PWROOT
update=0
elif ! test -d $PWROOT/CVS; then
update=0
fi
if ! test -d $TMPDIR; then
mkdir -p $TMPDIR
fi
if test "$update" = "0" ; then
cd $ROOT
/bin/rm -r espresso
cvs co espresso >& cvs.log
cd $PWROOT
mv ../cvs.log .
else
cd $PWROOT
cvs update -d >& cvs.log
fi
conflicts=`grep -c '^C ' cvs.log`
if test "$conflicts" != "0" ; then
echo "#" >> $OUT
echo "# CONFLICTS IN CVS CHECKOUT " >> $OUT
echo "#" >> $OUT
grep '^C ' cvs.log >> $OUT
mail -s "RESULTS OF DAILY QE TEST" $MAILTO < $OUT
exit 1
fi
changes=` grep -c -e '^U ' -e'^P ' cvs.log`
if test "$changes" = "0" ; then
#
# no changes to cvs, do nothing
#
exit 0
else
echo "#" >> $OUT
echo "# CHECKOUT ESPRESSO " >> $OUT
echo "#" >> $OUT
grep -e '^U ' -e'^P ' -e '^M ' cvs.log >> $OUT
fi
echo "#" >> $OUT
echo "# CONFIGURE " >> $OUT
echo "#" >> $OUT
./configure $CONFIG_OPTS >& configure.log
tail -1 config.log >> $OUT
echo "#" >> $OUT
echo "# MAKE ALL " >> $OUT
echo "#" >> $OUT
make all vib >& make.log
errors=`grep -c -e Error make.log`
if test "$errors" = "0" ; then
echo "make all: success" >> $OUT
else
echo "make all: failure! Last 50 lines from 'make all':" >> $OUT
echo "-------------------------------------------------" >> $OUT
tail -50 make.log >> $OUT
mail -s "RESULTS OF DAILY QE TEST" $MAILTO < $OUT
exit $errors
fi
cd examples
echo "#" >> $OUT
echo "# RUNNING ALL EXAMPLES " >> $OUT
echo "#" >> $OUT
mv environment_variables environment_variables.orig
cat > environment_variables << EOF
BIN_DIR=$PWROOT/bin
PSEUDO_DIR=$PWROOT/pseudo
TMP_DIR=$TMPDIR
PARA_PREFIX=
PARA_POSTFIX=
EOF
#
echo > run.log
###./run_all_examples >& run.log
#
# TESTING ALL EXAMPLES
#
example_list=`/bin/ls -d example??`
for example in $example_list
do
cd $PWROOT/examples/$example
if test "$example" = "example21" ; then
# the argument "64" to run_example is used in example 21
./run_example 64 >& run.log
elif test "$example" = "example26" ; then
# the arguments "1 7" to run_example are used in example 26
./run_example 1 7 >& run.log
else
# all other cases
./run_example >& run.log
fi
cat run.log >> ../run.log
/bin/rm run.log
N=`echo $example | sed 's/example//'`
echo "#" >> $OUT
echo "# CHECKING EXAMPLE # " $N >> $OUT
echo "#" >> $OUT
../check_example ./ >> $OUT
done
cd $PWROOT/examples
mv environment_variables.orig environment_variables
mail -s "RESULTS OF DAILY QE TEST" $MAILTO < $OUT