First step of many needed to reduce memory usage in k-point parallelization:

becsum used in stress calculation is now summed (not symmetrized) in sum_band.
Beware unexpected side effects (only with k-point parallelization)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13969 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2017-10-28 20:07:25 +00:00
parent 4747ccf1ee
commit 9916c7b53c
2 changed files with 20 additions and 13 deletions

View File

@ -81,18 +81,27 @@ subroutine stres_knl (sigmanlc, sigmakin)
! contribution from the nonlocal part
!
call stres_us (ik, gk, sigmanlc)
!
enddo
!
! add the US term from augmentation charge derivatives
deallocate(kfac)
deallocate(gk)
!
call addusstress (sigmanlc)
! the kinetic term must be summed over PW's and over k-points
!
call mp_sum( sigmakin, intra_bgrp_comm )
call mp_sum( sigmanlc, intra_bgrp_comm )
call mp_sum( sigmakin, inter_pool_comm )
!
! the nonlocal term is summed here only over k-points, because we add
! to it the US term from augmentation charge derivatives
!
call mp_sum( sigmanlc, inter_pool_comm )
!
! add US term from augmentation charge derivatives, sum result over PW's
!
call addusstress (sigmanlc)
call mp_sum( sigmanlc, intra_bgrp_comm )
!
do l = 1, 3
do m = 1, l - 1
sigmanlc (m, l) = sigmanlc (l, m)
@ -111,9 +120,7 @@ subroutine stres_knl (sigmanlc, sigmakin)
!
call symmatrix ( sigmakin )
call symmatrix ( sigmanlc )
deallocate(kfac)
deallocate(gk)
!
return
end subroutine stres_knl

View File

@ -130,8 +130,6 @@ SUBROUTINE sum_band()
!
IF( okpaw ) THEN
rho%bec(:,:,:) = becsum(:,:,:) ! becsum is filled in sum_band_{k|gamma}
! rho%bec has to be recollected and symmetrized, becsum must not, otherwise
! it will break stress routines.
CALL mp_sum(rho%bec, inter_pool_comm )
call mp_sum(rho%bec, inter_bgrp_comm )
CALL PAW_symmetrize(rho%bec)
@ -157,10 +155,12 @@ SUBROUTINE sum_band()
CALL addusdens(rho%of_r(:,:)) ! okvan is checked inside the routine
!
IF( okvan ) THEN
! bgrp_parallelization is done here but not in subsequent routines
! (in particular stress routines uses becsum). collect it across bgrp
call mp_sum(becsum, inter_bgrp_comm )
if (tqr) call mp_sum(ebecsum, inter_bgrp_comm )
! becsum is summed over bands (if bgrp_parallelization is done)
! and over k-points (but it is not symmetrized)
CALL mp_sum(becsum, inter_bgrp_comm )
CALL mp_sum(becsum, inter_pool_comm )
IF (tqr) CALL mp_sum(ebecsum, inter_pool_comm )
IF (tqr) CALL mp_sum(ebecsum, inter_bgrp_comm )
ENDIF
IF ( noncolin .AND. .NOT. domag ) rho%of_r(:,2:4)=0.D0
!