mirror of https://gitlab.com/QEF/q-e.git
small changes in output format, to make it easier for check_example
[Gerardo] git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@986 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
parent
45760a7a5f
commit
93a1f09187
|
@ -108,7 +108,7 @@ SUBROUTINE electrons()
|
|||
!
|
||||
CALL restart_in_electrons( iter, ik_, dr2 )
|
||||
!
|
||||
IF ( ik_ == - 1000 ) THEN
|
||||
IF ( ik_ == -1000 ) THEN
|
||||
!
|
||||
conv_elec = .TRUE.
|
||||
!
|
||||
|
@ -149,31 +149,33 @@ SUBROUTINE electrons()
|
|||
! ... first) the threshold is fixed to a default value of 1.D-5
|
||||
!
|
||||
IF ( istep > 1 ) ethr = 1.D-5
|
||||
IF ( imix >= 0 ) ngm0 = ngm
|
||||
!
|
||||
tcpu = get_clock( 'PWSCF' )
|
||||
WRITE( stdout, 9002 ) tcpu
|
||||
!
|
||||
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
!%%%%%%%%%%%%%%%%%%%% iterate ! %%%%%%%%%%%%%%%%%%%%%
|
||||
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
!
|
||||
IF ( imix >= 0 ) ngm0 = ngm
|
||||
IF ( lscf ) THEN
|
||||
WRITE( stdout, 9000 )
|
||||
ELSE
|
||||
WRITE( stdout, 9009 )
|
||||
END IF
|
||||
!
|
||||
#if defined (FLUSH)
|
||||
CALL flush( stdout )
|
||||
#endif
|
||||
!
|
||||
DO idum = 1, niter
|
||||
!
|
||||
tcpu = get_clock( 'PWSCF' )
|
||||
!
|
||||
WRITE( stdout, 9000 ) tcpu
|
||||
!
|
||||
IF ( imix >= 0 ) rho_save = rho
|
||||
!
|
||||
iter = iter + 1
|
||||
!
|
||||
IF ( lscf ) THEN
|
||||
!
|
||||
WRITE( stdout, 9010 ) iter, ecutwfc, mixing_beta
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
WRITE( stdout, 9009 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
#if defined (FLUSH)
|
||||
|
@ -213,6 +215,11 @@ SUBROUTINE electrons()
|
|||
!
|
||||
CALL poolrecover( et, nbnd, nkstot, nks )
|
||||
!
|
||||
tcpu = get_clock( 'PWSCF' )
|
||||
WRITE( stdout, 9002 ) tcpu
|
||||
!
|
||||
WRITE( stdout, 9102 )
|
||||
!
|
||||
DO ik = 1, nkstot
|
||||
!
|
||||
IF ( lsda ) THEN
|
||||
|
@ -402,6 +409,11 @@ SUBROUTINE electrons()
|
|||
!
|
||||
CALL save_in_electrons( iter, dr2 )
|
||||
!
|
||||
tcpu = get_clock( 'PWSCF' )
|
||||
WRITE( stdout, 9002 ) tcpu
|
||||
!
|
||||
IF ( conv_elec ) WRITE( stdout, 9101 )
|
||||
!
|
||||
IF ( ( conv_elec .OR. MOD( iter, iprint ) == 0 ) .AND. &
|
||||
iswitch <= 2 ) THEN
|
||||
!
|
||||
|
@ -448,7 +460,6 @@ SUBROUTINE electrons()
|
|||
etot = eband + ( etxc - etxcc ) + ewld + ehart + deband + demet
|
||||
!
|
||||
IF ( lda_plus_u ) etot = etot + eth
|
||||
!
|
||||
IF ( tefield ) etot = etot + etotefield
|
||||
!
|
||||
IF ( ( conv_elec .OR. MOD( iter, iprint ) == 0 ) .AND. &
|
||||
|
@ -537,6 +548,8 @@ SUBROUTINE electrons()
|
|||
!
|
||||
END DO
|
||||
!
|
||||
IF ( lscf ) WRITE( stdout, 9101 )
|
||||
!
|
||||
WRITE( stdout, 9120 )
|
||||
!
|
||||
! <------- jump here if not scf
|
||||
|
@ -549,7 +562,8 @@ SUBROUTINE electrons()
|
|||
!
|
||||
! ... formats
|
||||
!
|
||||
9000 FORMAT(/' total cpu time spent up to now is ',F9.2,' secs')
|
||||
9000 FORMAT(/' Self-consistent Calculation')
|
||||
9002 FORMAT(/' total cpu time spent up to now is ',F9.2,' secs')
|
||||
9009 FORMAT(/' Band Structure Calculation')
|
||||
9010 FORMAT(/' iteration #',I3,' ecut=',F9.2,' ryd',5X, &
|
||||
'beta=',F4.2)
|
||||
|
@ -584,8 +598,10 @@ SUBROUTINE electrons()
|
|||
/' potential mean squ. error =',1PE15.1,' ryd^2')
|
||||
9090 FORMAT(/' the final potential is written on file ',A14)
|
||||
9100 FORMAT(/' this iteration took ',F9.2,' cpu secs')
|
||||
9101 FORMAT(/' End of self-consistent calculation')
|
||||
9102 FORMAT(/' End of band structure calculation')
|
||||
9110 FORMAT(/' convergence has been achieved')
|
||||
9120 FORMAT(/' convergence NOT achieved. stopping ...')
|
||||
9120 FORMAT(/' convergence NOT achieved, stopping')
|
||||
!
|
||||
CONTAINS
|
||||
!
|
||||
|
|
|
@ -3,6 +3,15 @@
|
|||
# check directories given as arguments, current directory if none
|
||||
if test $# = 0 ; then args="." ; else args="$@"; fi
|
||||
|
||||
# pwdiff.sh must be in the same directory as this script
|
||||
dir=`echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
|
||||
pwdiff=$dir/pwdiff.sh
|
||||
if ! test -x "$pwdiff"
|
||||
then
|
||||
echo error: file pwdiff.sh not found or not executable
|
||||
exit -1
|
||||
fi
|
||||
|
||||
n_wrong=0
|
||||
for dir in $args
|
||||
do
|
||||
|
@ -29,7 +38,7 @@ do
|
|||
for file in $output
|
||||
do
|
||||
echo " "checking $file...
|
||||
if ! ./pwdiff.sh $EXAMPLEDIR/reference/$file $EXAMPLEDIR/results/$file
|
||||
if ! $pwdiff $EXAMPLEDIR/reference/$file $EXAMPLEDIR/results/$file
|
||||
then
|
||||
wrong="$wrong $file"
|
||||
let n_wrong=n_wrong+1
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
#!/usr/bin/awk -f
|
||||
|
||||
# postdiff.awk -- postprocessor for checking outputs of PWscf examples
|
||||
# checking is done in three steps: preprocess, diff against reference
|
||||
# data, postprocess
|
||||
# this way "false positives" are eliminated, that is, differences that
|
||||
# don't mean that something went wrong
|
||||
|
||||
# for each (group of) line(s)
|
||||
{
|
||||
# read block of lines from output of diff
|
||||
|
|
|
@ -1,10 +1,20 @@
|
|||
#!/usr/bin/awk -f
|
||||
|
||||
# prediff.awk -- preprocessor for checking outputs of PWscf examples
|
||||
# checking is done in three steps: preprocess, diff against reference
|
||||
# data, postprocess
|
||||
# this way "false positives" are eliminated, that is, differences that
|
||||
# don't mean that something went wrong
|
||||
|
||||
# for each (group of) line(s)
|
||||
{ check_line(); }
|
||||
|
||||
function check_line()
|
||||
{
|
||||
# mark (groups of) lines that may be "false positives", by prepending
|
||||
# a key of the form "@key@"
|
||||
# postprocessor will check them based on key
|
||||
|
||||
if (match($0, "Today is") || match($0, "cpu time") || match($0, "CPU"))
|
||||
{
|
||||
print_key("TIMING");
|
||||
|
@ -64,19 +74,20 @@ function check_line()
|
|||
{
|
||||
print_key("KWEIGHT");
|
||||
}
|
||||
else if (match($0, "iteration #.*ecut=.*beta="))
|
||||
else if (match($0, "Self-consistent Calculation"))
|
||||
{
|
||||
print_key("ITERATION");
|
||||
while (getline && ! match($0, "!") && ! match($0, "bands") \
|
||||
&& ! match($0, "the Fermi energy is"))
|
||||
while (getline && ! match($0, "End of self-consistent calculation"))
|
||||
print_key("ITERATION");
|
||||
print_key("ITERATION");
|
||||
print "@CHECKPOINT@";
|
||||
check_line();
|
||||
}
|
||||
else if (match($0, "WARNING:.*eigenvalues not converged") \
|
||||
|| match($0, "avg # of iterations"))
|
||||
else if (match($0, "Band Structure Calculation"))
|
||||
{
|
||||
print_key("ITERATION");
|
||||
while (getline && ! match($0, "End of band structure calculation"))
|
||||
print_key("ITERATION");
|
||||
print_key("ITERATION");
|
||||
}
|
||||
else if (match($0, "band energies") || match($0, "bands"))
|
||||
{
|
||||
|
|
|
@ -1,5 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
# pwdiff.sh -- script for checking outputs of PWscf examples
|
||||
# checking is done in three steps: preprocess, diff against reference
|
||||
# data, postprocess
|
||||
# this way "false positives" are eliminated, that is, differences that
|
||||
# don't mean that something went wrong
|
||||
|
||||
# pre/postprocessing scripts must be in the same directory as this one
|
||||
dir=`echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
|
||||
prediff=$dir/prediff.awk
|
||||
postdiff=$dir/postdiff.awk
|
||||
if ! test -f "$prediff"
|
||||
then
|
||||
echo error: file prediff.awk not found
|
||||
exit -1
|
||||
fi
|
||||
if ! test -f "$postdiff"
|
||||
then
|
||||
echo error: file postdiff.awk not found
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# check that files exist
|
||||
if ! test -f "$1"
|
||||
then
|
||||
|
@ -13,8 +34,8 @@ then
|
|||
fi
|
||||
|
||||
# preprocess
|
||||
awk -f prediff.awk $1 > pwdiff.sh.tmp1
|
||||
awk -f prediff.awk $2 > pwdiff.sh.tmp2
|
||||
awk -f $prediff $1 > pwdiff.sh.tmp1
|
||||
awk -f $prediff $2 > pwdiff.sh.tmp2
|
||||
|
||||
# uncomment to debug
|
||||
# cp pwdiff.sh.tmp1 pwdiff.sh.tmp6
|
||||
|
@ -26,6 +47,7 @@ offset2=0
|
|||
check1=1
|
||||
check2=1
|
||||
|
||||
# check preprocessed files
|
||||
while test $check1 -gt 0 || test $check2 -gt 0
|
||||
do
|
||||
# look for next checkpoints
|
||||
|
@ -47,9 +69,9 @@ do
|
|||
head -$check1 pwdiff.sh.tmp1 > pwdiff.sh.tmp3
|
||||
head -$check2 pwdiff.sh.tmp2 > pwdiff.sh.tmp4
|
||||
|
||||
# diff up to next checkpoint, then postprocess
|
||||
# diff up to next checkpoints, then postprocess
|
||||
diff pwdiff.sh.tmp3 pwdiff.sh.tmp4 \
|
||||
| awk -f postdiff.awk o1=$offset1 o2=$offset2 >> pwdiff.sh.tmp5
|
||||
| awk -f $postdiff o1=$offset1 o2=$offset2 >> pwdiff.sh.tmp5
|
||||
|
||||
# discard processed part
|
||||
sed "1,${check1}d" pwdiff.sh.tmp1 > pwdiff.sh.tmp3
|
||||
|
@ -60,7 +82,7 @@ do
|
|||
offset2=`expr $offset2 + $check2 + $eof2 - 1`
|
||||
done
|
||||
|
||||
# return success if there's no output, failure otherwise (just like diff)
|
||||
# return success if there's no output, failure otherwise (as diff does)
|
||||
rvalue=`wc pwdiff.sh.tmp5 | awk '{print ($1 == 0) ? 0 : 1}'`
|
||||
cat pwdiff.sh.tmp5
|
||||
rm -f pwdiff.sh.tmp[1-5]
|
||||
|
|
Loading…
Reference in New Issue