Commit 1224e9fd authored by giannozz's avatar giannozz

EXX with k-point parallelization: obsolete routine wg_all removed


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12195 c92efa57-630b-4861-b058-cf58834340f0
parent 59896009
......@@ -658,7 +658,6 @@ MODULE exx
COMPLEX(DP), ALLOCATABLE :: temppsic_all_nc(:,:), psic_all_nc(:,:)
#endif
COMPLEX(DP) :: d_spin(2,2,48)
REAL(DP), ALLOCATABLE :: wg_collect (:,:)
INTEGER :: npw, current_ik
integer :: find_current_k
......@@ -703,23 +702,20 @@ MODULE exx
IF ( .NOT. gamma_only ) CALL exx_set_symm ( )
! set appropriately the x_occupation and get an upperbound to the number of
! bands with non zero occupation. used to distribute bands among band groups
! set occupations of wavefunctions used in the calculation of exchange term
ALLOCATE(wg_collect(nbnd,nks))
DO ik =1,nks
IF(ABS(wk(ik)) > eps_occ ) THEN
wg_collect(1:nbnd,ik) = wg (1:nbnd, ik) / wk(ik)
x_occupation(1:nbnd,ik) = wg (1:nbnd, ik) / wk(ik)
ELSE
wg_collect(1:nbnd,ik) = 0._dp
x_occupation(1:nbnd,ik) = 0._dp
ENDIF
ENDDO
IF (npool>1) THEN
CALL wg_all(x_occupation, wg_collect, nkstot, nks)
ELSE
x_occupation(:,1:nks) = wg_collect(:,1:nks)
ENDIF
DEALLOCATE (wg_collect)
CALL poolcollect(x_occupation, nbnd, nkstot, nks)
! find an upper bound to the number of bands with non zero occupation.
! Useful to distribute bands among band groups
x_nbnd_occ = 0
DO ik =1,nkstot
DO ibnd = max(1,x_nbnd_occ), nbnd
......
......@@ -236,7 +236,7 @@ SUBROUTINE poolcollect( vec, length, nkstot, nks )
! ... of all pools - Quick-and-dirty implementation
!
USE kinds, ONLY : DP
USE mp_pools, ONLY : root_pool, inter_pool_comm
USE mp_pools, ONLY : root_pool, inter_pool_comm, intra_pool_comm
USE mp, ONLY : mp_bcast
!
IMPLICIT NONE
......
......@@ -63,61 +63,6 @@ SUBROUTINE xk_wk_collect( xk_collect, xk, nkstot, nks )
!
END SUBROUTINE xk_wk_collect
!
!----------------------------------------------------------------------------
SUBROUTINE wg_all(wg_collect, wg, nkstot, nks )
!----------------------------------------------------------------------------
!
! ... This routine collects all the weights and copy them in all pools.
!
USE kinds, ONLY : DP
USE mp_pools, ONLY : my_pool_id, npool, kunit, inter_pool_comm
USE mp, ONLY : mp_sum
USE wvfct, ONLY : nbnd
!
IMPLICIT NONE
!
INTEGER :: nkstot, nks
! total number of k-points
! number of k-points per pool
REAL (DP) :: wg(nbnd, nks)
REAL (DP) :: wg_collect(nbnd, nkstot)
! distributed weights of the k points of this pool
! collected weights of all k points
!
#if defined (__MPI)
!
INTEGER :: nbase, rest, nks1
!
wg_collect=(0.0_DP, 0.0_DP)
!
nks1 = ( nkstot / npool )
!
rest = ( nkstot - nks1 * npool )
!
IF ( ( my_pool_id + 1 ) <= rest ) nks1 = nks1 + 1
!
IF (nks1.ne.nks) &
call errore('wg_all','problems with nks1',1)
!
! ... calculates nbase = the position in the list of the first point that
! ... belong to this npool - 1
!
nbase = nks * my_pool_id
!
IF ( ( my_pool_id + 1 ) > rest ) nbase = nbase + rest
!
! copy the original wavefunctions in the correct position of the list
!
wg_collect(:,nbase+1:nbase+nks) = wg(:,1:nks)
!
CALL mp_sum( wg_collect, inter_pool_comm )
!
#endif
!
RETURN
!
END SUBROUTINE wg_all
!
!
INTEGER FUNCTION find_current_k(ik, nkstot, nks)
!----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment