Skip to content

Commit

Permalink
PWscf in "driver" mode with i-Pi wasn't working with k-points and wasn't
Browse files Browse the repository at this point in the history
honoring options for interpolation - Thanks to Przemyslaw Juda


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@14037 c92efa57-630b-4861-b058-cf58834340f0
  • Loading branch information
giannozz authored and pietrodelugas committed Dec 10, 2017
1 parent 425d2a1 commit 4dbab2d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 39 deletions.
10 changes: 8 additions & 2 deletions Doc/release-notes
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ New in 6.2.1 version:

Problems fixed in 6.2.1 version:

* PWscf in "driver" mode with i-Pi wasn't working with k-points and
wasn't honoring options for interpolation - fixed by Przemyslaw Juda
(r14037)

* Restart in phonon wasn't working with tetrahedra (r14029)
and for USPP/PAW at q != 0 (r14034)
and for USPP/PAW at q != 0 (r14034-14036)

* QM-MM interface with LAMMPS was broken in v.6.2 (r14006-14008)

Expand Down Expand Up @@ -39,7 +43,9 @@ Problems fixed in 6.2.1 version:

Known problems in 6.2.1 version:

* QM-MM not yet working
* pw2bgw.x not working

* QM-MM not yet working; COUPLE interface not aligned with new parallelism

* New format for charge density no longer allows to perform a non-scf
calculation with k-points starting from a scf calculation at Gamma
Expand Down
8 changes: 4 additions & 4 deletions Modules/read_input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ SUBROUTINE read_input_file ( prog, input_file_ )
!
IMPLICIT NONE
!
CHARACTER(LEN=2), INTENT (IN) :: prog
CHARACTER(LEN=*), INTENT (IN) :: prog
CHARACTER(LEN=*), INTENT (IN) :: input_file_
!
CHARACTER(LEN=iotk_attlenx) :: attr
LOGICAL :: xmlinput
INTEGER :: ierr
!
IF ( ionode ) THEN
IF ( prog == 'CP' ) CALL xml_input_dump()
IF ( prog(1:2) == 'CP' ) CALL xml_input_dump()
ierr = open_input_file( input_file_, xmlinput, attr)
END IF
!
Expand All @@ -67,9 +67,9 @@ SUBROUTINE read_input_file ( prog, input_file_ )
!
CALL read_namelists( prog, qestdin )
!
! ... Read CARDS
! ... Read CARDS (requires in input only first two letters of prog)
!
CALL read_cards ( prog, qestdin )
CALL read_cards ( prog(1:2), qestdin )
!
END IF
IF ( ionode) ierr = close_input_file( )
Expand Down
49 changes: 20 additions & 29 deletions Modules/read_namelists.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ SUBROUTINE fixval( prog )
!=----------------------------------------------------------------------=!
!
!-----------------------------------------------------------------------
SUBROUTINE read_namelists( prog, unit )
SUBROUTINE read_namelists( prog_, unit )
!-----------------------------------------------------------------------
!
! this routine reads data from standard input and puts them into
Expand All @@ -1822,17 +1822,17 @@ SUBROUTINE read_namelists( prog, unit )
!
! ... declare variables
!
CHARACTER(LEN=2) :: prog ! ... specify the calling program
! prog = 'PW' pwscf
! prog = 'CP' cpr
!
CHARACTER(LEN=*) :: prog_ ! specifies the calling program, allowed:
! prog = 'PW' pwscf
! prog = 'CP' cp
! prog = 'PW+iPi' pwscf + i-Pi
!
INTEGER, INTENT(IN), optional :: unit
!
! ... declare other variables
!
CHARACTER(LEN=2) :: prog
INTEGER :: ios
!
INTEGER :: unit_loc=5
!
! ... end of declarations
Expand All @@ -1841,25 +1841,23 @@ SUBROUTINE read_namelists( prog, unit )
!
IF(PRESENT(unit)) unit_loc = unit
!
prog = prog_(1:2) ! Allowed: 'PW' or 'CP'
IF( prog /= 'PW' .AND. prog /= 'CP' ) &
CALL errore( ' read_namelists ', ' unknown calling program ', 1 )
!
! ... default settings for all namelists
!
IF( prog == 'PW' .OR. prog == 'CP') THEN
CALL control_defaults( prog )
CALL system_defaults( prog )
CALL electrons_defaults( prog )
CALL ions_defaults( prog )
CALL cell_defaults( prog )
ENDIF
CALL control_defaults( prog )
CALL system_defaults( prog )
CALL electrons_defaults( prog )
CALL ions_defaults( prog )
CALL cell_defaults( prog )
!
! ... Here start reading standard input file
!
!
! ... CONTROL namelist
!
IF(prog == 'PW' .OR. prog == 'CP' ) THEN
ios = 0
IF( ionode ) THEN
READ( unit_loc, control, iostat = ios )
Expand Down Expand Up @@ -1897,22 +1895,17 @@ SUBROUTINE read_namelists( prog, unit )
CALL electrons_bcast( )
CALL electrons_checkin( prog )
!
! ... IONS namelist
! ... IONS namelist - must be read only if ionic motion is expected,
! ... or if code called by i-Pi via run_driver
!
ios = 0
IF ( ionode ) THEN
!
IF ( TRIM( calculation ) == 'relax' .OR. &
TRIM( calculation ) == 'md' .OR. &
TRIM( calculation ) == 'vc-relax' .OR. &
TRIM( calculation ) == 'vc-md' .OR. &
TRIM( calculation ) == 'cp' .OR. &
TRIM( calculation ) == 'vc-cp' .OR. &
TRIM( calculation ) == 'smd' .OR. &
TRIM( calculation ) == 'cp-wf-nscf' .OR. &
TRIM( calculation ) == 'vc-cp-wf' .OR. &
TRIM( calculation ) == 'cp-wf' ) READ( unit_loc, ions, iostat = ios )

IF ( ( TRIM( calculation ) /= 'scf' .AND. &
TRIM( calculation ) /= 'nscf' .AND. &
TRIM( calculation ) /= 'bands' ) .OR. &
( TRIM( prog_ ) == 'PW+iPi' ) ) THEN
READ( unit_loc, ions, iostat = ios )
END IF
END IF
CALL check_namelist_read(ios, unit_loc, "ions")
!
Expand Down Expand Up @@ -1976,8 +1969,6 @@ SUBROUTINE read_namelists( prog, unit )
CALL wannier_ac_bcast()
CALL wannier_ac_checkin( prog )
!
ENDIF
!
RETURN
!
END SUBROUTINE read_namelists
Expand Down
2 changes: 1 addition & 1 deletion PW/src/pwscf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ PROGRAM pwscf
!
ELSE
!
CALL read_input_file ('PW', input_file_ )
CALL read_input_file ('PW+iPi', input_file_ )
CALL run_driver ( srvaddress, exit_status )
!
END IF
Expand Down
37 changes: 35 additions & 2 deletions PW/src/run_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SUBROUTINE run_driver ( srvaddress, exit_status )
USE ener, ONLY : etot
USE f90sockets, ONLY : readbuffer, writebuffer
USE extrapolation, ONLY : update_file, update_pot
USE io_files, ONLY : iunupdate, nd_nmbr, prefix, tmp_dir, wfc_dir, delete_if_present, seqopn
!
IMPLICIT NONE
INTEGER, INTENT(OUT) :: exit_status
Expand Down Expand Up @@ -184,7 +185,7 @@ SUBROUTINE driver_init()
! ... see lgreset below
!
IF ( ionode ) write(*,*) " @ DRIVER MODE: Resetting scf history "
CALL close_files(.TRUE.)
CALL reset_history_for_extrapolation()
END IF
!
rid_old = rid
Expand Down Expand Up @@ -340,7 +341,7 @@ SUBROUTINE initialize_g_vectors()
! ... Reset the history
!
CALL clean_pw( .FALSE. )
IF ( .NOT. firststep) CALL close_files(.TRUE.)
IF ( .NOT. firststep) CALL reset_history_for_extrapolation()
!
CALL init_run()
!
Expand All @@ -355,6 +356,38 @@ SUBROUTINE initialize_g_vectors()
!
END SUBROUTINE initialize_g_vectors
!
SUBROUTINE reset_history_for_extrapolation()
!
! ... Resets history of wavefunction and rho as if the
! ... previous step was the first one in the calculation.
! ... To this end, files with rho and wfc from previous steps
! ... must be deleted, and iunupdate unit wiped. The latter
! ... is achieved by deleting the file and recreating it using
! ... update_file() routine.
!
IMPLICIT NONE
LOGICAL :: exst
!
! ... Delete history files, names correspond to the ones
! ... in the update_pot() routine.
!
CALL delete_if_present(TRIM( wfc_dir ) // TRIM( prefix ) // '.oldwfc' // nd_nmbr)
CALL delete_if_present(TRIM( wfc_dir ) // TRIM( prefix ) // '.old2wfc' // nd_nmbr)
IF ( ionode ) THEN
CALL delete_if_present(TRIM( tmp_dir ) // TRIM( prefix ) // '.save/' // 'charge-density.old.dat')
CALL delete_if_present(TRIM( tmp_dir ) // TRIM( prefix ) // '.save/' // 'charge-density.old2.dat')
!
! ... The easiest way to wipe the iunupdate unit, is to delete it
! ... and run update_file(), which will recreate the file
!
CALL seqopn( iunupdate, 'update', 'FORMATTED', exst )
CLOSE(UNIT=iunupdate, STATUS='DELETE')
END IF
!
CALL update_file()
!
END SUBROUTINE
!
END SUBROUTINE run_driver

FUNCTION get_server_address ( command_line ) RESULT ( srvaddress )
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh -x

version=6.2.1
revision=14034
revision=14035
user=giannozz
tempdir=$HOME/tempdir

Expand Down

0 comments on commit 4dbab2d

Please sign in to comment.