Commit 43b25322 authored by ccavazzoni's avatar ccavazzoni

- logical flag have_task_groups removed from FFT type.

- FFT type now do not have any information about task group:
  no need to temporary change the value of variable...
- When task group are not needed symple do not use "dtgs" data type
- FFT interfaces called with FFT datatype ONLY, do not perform
  task groups trics any longer, this should simply thing a bit....




git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12628 c92efa57-630b-4861-b058-cf58834340f0
parent 46e6103c
......@@ -381,7 +381,7 @@ CONTAINS
!
ELSE
!
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
!
ALLOCATE( exx_potential(dffts%nnr,nproc_image/dtgs%nogrp) )
!
......
......@@ -159,7 +159,7 @@
iss2 = iss1
END IF
!
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
!
!===============================================================================
!exx_wf related
......@@ -293,7 +293,7 @@
!$omp task default(none) &
!$omp private( fi, fip, fp, fm, ig ) &
!$omp firstprivate( eig_offset, igno, idx, nogrp_, ngw, tpiba2, me_bgrp, i, n, tens ) &
!$omp shared( f, aux, df, da, c, dffts, g2kin, nls, nlsm )
!$omp shared( f, aux, df, da, c, dffts, dtgs, g2kin, nls, nlsm )
IF( idx + i - 1 <= n ) THEN
if (tens) then
......@@ -303,7 +303,7 @@
fi = -0.5d0*f(i+idx-1)
fip = -0.5d0*f(i+idx)
endif
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
DO ig=1,ngw
fp= aux(nls(ig)+eig_offset) + aux(nlsm(ig)+eig_offset)
fm= aux(nls(ig)+eig_offset) - aux(nlsm(ig)+eig_offset)
......
......@@ -81,7 +81,7 @@
IF( restart ) iflag = 2
END IF
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
tg_rhos_siz = dtgs%nogrp * dtgs%tg_nnr
c2_siz = dtgs%nogrp * ngwx
ELSE
......@@ -125,7 +125,7 @@
c2 = 0D0
c3 = 0D0
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
!
! The potential in rhos is distributed across all processors
! We need to redistribute it so that it is completely contained in the
......@@ -146,7 +146,7 @@
DO i = 1, nbsp_bgrp, incr
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
!
!The input coefficients to dforce cover eigenstates i:i+2*NOGRP-1
!Thus, in dforce the dummy arguments for c0_bgrp(1,i) and
......@@ -316,7 +316,7 @@
USE electrons_base, ONLY : ispin, nspin, f, n=>nbsp
USE cp_interfaces, ONLY : dforce
USE gvecw, ONLY: ngw
USE fft_base, ONLY: dffts
USE fft_base, ONLY: dffts, dtgs
USE electrons_base, ONLY: nx=>nbnd, nupdwn, iupdwn, nbspx, nbsp
USE mp, ONLY: mp_sum
USE mp_global, ONLY: intra_bgrp_comm
......@@ -357,7 +357,7 @@
'Electric field and sic are not implemented',2)
IF( nspin == 1 ) CALL errore(' runcp_force_pairing ',' inconsistent nspin ', 1)
IF( dffts%have_task_groups ) CALL errore(' runcp_force_pairing ',' task_groups not implemented ', 1)
IF( dtgs%have_task_groups ) CALL errore(' runcp_force_pairing ',' task_groups not implemented ', 1)
!
ALLOCATE( emadt2( ngw ) )
ALLOCATE( emaver( ngw ) )
......
......@@ -76,11 +76,8 @@
CALL start_clock ('dvqpsi_us')
!IF (nlcc_any) THEN
! SP - changed according to QE5/PH/dvqpsi_us
!htg = dffts%have_task_groups
npw = ngk(ik)
dffts%have_task_groups=.FALSE.
IF (nlcc_any.AND.addnlcc) THEN
ALLOCATE (aux( dfftp%nnr))
IF (doublegrid) then
......
......@@ -126,11 +126,8 @@ SUBROUTINE invfft_x( grid_type, f, dfft, dtgs )
CALL tg_cft3s( f, dfft, 1 )
ELSE IF( grid_type == 'Wave' .OR. grid_type == 'CustomWave' ) THEN
IF( PRESENT( dtgs ) ) THEN
CALL tg_cft3s( f, dfft, 2, dtgs, dfft%have_task_groups )
CALL tg_cft3s( f, dfft, 2, dtgs )
ELSE
IF( dfft%have_task_groups ) THEN
CALL fftx_error__( ' invfft ', ' have_task_groups is true but dtgs is not present ', 1 )
END IF
CALL tg_cft3s( f, dfft, 2 )
END IF
END IF
......@@ -238,11 +235,8 @@ SUBROUTINE fwfft_x( grid_type, f, dfft, dtgs )
CALL tg_cft3s(f,dfft,-1)
ELSE IF( grid_type == 'Wave' .OR. grid_type == 'CustomWave' ) THEN
IF( PRESENT( dtgs ) ) THEN
CALL tg_cft3s(f,dfft,-2, dtgs, dfft%have_task_groups )
CALL tg_cft3s(f,dfft,-2, dtgs )
ELSE
IF( dfft%have_task_groups ) THEN
CALL fftx_error__( ' fwfft ', ' have_task_groups is true but dtgs is not present ', 1 )
END IF
CALL tg_cft3s(f,dfft,-2 )
END IF
END IF
......
......@@ -31,7 +31,7 @@ CONTAINS
! General purpose driver, including Task groups parallelization
!
!----------------------------------------------------------------------------
SUBROUTINE tg_cft3s( f, dfft, isgn, dtgs, use_task_groups )
SUBROUTINE tg_cft3s( f, dfft, isgn, dtgs )
!----------------------------------------------------------------------------
!
!! ... isgn = +-1 : parallel 3d fft for rho and for the potential
......@@ -77,7 +77,6 @@ SUBROUTINE tg_cft3s( f, dfft, isgn, dtgs, use_task_groups )
TYPE (fft_dlay_descriptor), INTENT(in) :: dfft
! descriptor of fft data layout
INTEGER, INTENT(in) :: isgn ! fft direction
LOGICAL, OPTIONAL, INTENT(in) :: use_task_groups
TYPE (task_groups_descriptor), OPTIONAL, INTENT(in) :: dtgs
! specify if you want to use task groups parallelization
!
......@@ -98,15 +97,12 @@ SUBROUTINE tg_cft3s( f, dfft, isgn, dtgs, use_task_groups )
LOGICAL :: use_tg
!
!
IF( present( use_task_groups ) ) THEN
use_tg = use_task_groups
IF( present( dtgs ) ) THEN
use_tg = dtgs%have_task_groups
ELSE
use_tg = .false.
ENDIF
!
IF( use_tg .and. .not. dfft%have_task_groups ) &
CALL fftx_error__( ' tg_cft3s ', ' call requiring task groups for a descriptor without task groups ', 1 )
!
n1 = dfft%nr1
n2 = dfft%nr2
n3 = dfft%nr3
......
......@@ -69,31 +69,6 @@ MODULE fft_types
INTEGER :: nproc = 1 ! number of processor in the fft group
INTEGER :: root = 0 ! root processor
!
! task groups
!
LOGICAL :: have_task_groups
!
#ifdef PIPPONE
INTEGER :: me_pgrp = 0 ! task id for plane wave task group
INTEGER :: nogrp = 1 ! number of proc. in an orbital "task group"
INTEGER :: npgrp = 1 ! number of proc. in a plane-wave "task group"
INTEGER :: ogrp_comm = 0 ! orbital group communicator
INTEGER :: pgrp_comm = 0 ! plane-wave group communicator
INTEGER, POINTER :: nolist(:) ! list of pes in orbital group
INTEGER, POINTER :: nplist(:) ! list of pes in pw group
!
INTEGER :: tg_nnr = 0 ! maximum among nnr
INTEGER, POINTER :: tg_nsw(:) ! number of sticks per task group ( wave func )
INTEGER, POINTER :: tg_npp(:) ! number of "Z" planes per task group
INTEGER, POINTER :: tg_snd(:) ! number of element to be sent in group redist
INTEGER, POINTER :: tg_rcv(:) ! number of element to be received in group redist
INTEGER, POINTER :: tg_psdsp(:)! send displacement for all to all (pack)
INTEGER, POINTER :: tg_usdsp(:)! send displacement for all to all (unpack)
INTEGER, POINTER :: tg_rdsp(:)! receive displacement for all to all
INTEGER :: tg_nppx = 0 ! max of tg_npp
INTEGER :: tg_ncpx = 0 ! max of tg_ncpx
#endif
!
END TYPE
......@@ -183,7 +158,6 @@ CONTAINS
desc%comm = comm
desc%nproc = nproc
desc%root = root
desc%have_task_groups = ( nogrp > 1 )
desc%arrays_have_been_allocated = .TRUE.
......@@ -203,7 +177,6 @@ CONTAINS
IF ( associated( desc%iplp ) ) DEALLOCATE( desc%iplp )
IF ( associated( desc%iplw ) ) DEALLOCATE( desc%iplw )
desc%id = 0
desc%have_task_groups = .FALSE.
desc%arrays_have_been_allocated = .FALSE.
desc%dimensions_have_been_set = .FALSE.
......@@ -230,7 +203,6 @@ CONTAINS
desc%nproc = nproc
desc%comm = comm
desc%root = root
desc%have_task_groups = .false.
END SUBROUTINE fft_box_allocate
SUBROUTINE fft_box_deallocate( desc )
......@@ -241,7 +213,6 @@ CONTAINS
IF( associated( desc%npp ) ) DEALLOCATE( desc%npp )
IF( associated( desc%ipp ) ) DEALLOCATE( desc%ipp )
IF( associated( desc%np3 ) ) DEALLOCATE( desc%np3 )
desc%have_task_groups = .false.
END SUBROUTINE fft_box_deallocate
!=----------------------------------------------------------------------------=!
......@@ -562,7 +533,6 @@ CONTAINS
ENDDO
desc%have_task_groups = .false.
END SUBROUTINE fft_box_set
......@@ -618,7 +588,6 @@ CONTAINS
desc%npp = nr3
desc%ipp = 0
!
desc%have_task_groups = .false.
RETURN
END SUBROUTINE fft_dlay_scalar
......
......@@ -252,7 +252,6 @@
IF( PRESENT( dtgs ) ) THEN
CALL task_groups_init( dffts, dtgs, nogrp_ )
ELSE
dffts%have_task_groups = .FALSE.
IF( nogrp_ > 1 ) THEN
CALL fftx_error__( ' pstickset ', &
& ' more than one Task Groups is requested, but the Task Group descriptor is not initialized ', 1 )
......
......@@ -106,12 +106,6 @@ SUBROUTINE task_groups_init( dffts, dtgs, nogrp )
CALL task_groups_init_first( dffts, dtgs, nogrp )
!
#if defined(DEBUG)
IF ( dffts%nogrp > 1 ) WRITE( stdout, 100 ) dffts%nogrp, dffts%npgrp
100 FORMAT( /,3X,'Task Groups are in USE',/,3X,'groups and procs/group : ',I5,I5 )
#endif
!Find maximum chunk of local data concerning coefficients of eigenfunctions in g-space
#if defined(__MPI)
......@@ -208,7 +202,7 @@ SUBROUTINE task_groups_init_first( dffts, dtgs, nogrp )
!
!SUBDIVIDE THE PROCESSORS IN GROUPS
!
dffts%have_task_groups = ( nogrp > 1 )
dtgs%have_task_groups = ( nogrp > 1 )
dtgs%me_pgrp = 0
IF( MOD( dtgs%nproc, MAX( 1, nogrp ) ) /= 0 ) &
......
......@@ -28,7 +28,7 @@ SUBROUTINE apply_dpot(nrxxs, aux1, dv, current_spin)
!
! Noncollinear part with task groups
!
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
IF (domag) THEN
DO ir=1, dffts%nr1x*dffts%nr2x*dtgs%tg_npp( me_bgrp + 1 )
sup = aux1(ir,1) * (dv(ir,1)+dv(ir,4)) + &
......@@ -66,7 +66,7 @@ SUBROUTINE apply_dpot(nrxxs, aux1, dv, current_spin)
!
! collinear part with Task Groups
!
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
!
DO ir = 1, dffts%nr1x*dffts%nr2x*dtgs%tg_npp( me_bgrp + 1 )
aux1 (ir,1) = aux1 (ir,1) * dv(ir,1)
......
......@@ -18,7 +18,7 @@ SUBROUTINE ch_psi_all (n, h, ah, e, ik, m)
USE wvfct, ONLY : npwx, nbnd, current_k
USE becmod, ONLY : bec_type, becp, calbec
USE uspp, ONLY : nkb, vkb
USE fft_base, ONLY : dffts
USE fft_base, ONLY : dffts, dtgs
USE gvect, ONLY : g
USE klist, ONLY : xk, igk_k
USE noncollin_module, ONLY : noncolin, npol
......@@ -62,8 +62,6 @@ SUBROUTINE ch_psi_all (n, h, ah, e, ik, m)
!
! This routine is task groups aware
!
IF (ntask_groups > 1) dffts%have_task_groups=.TRUE.
ALLOCATE (ps ( nbnd , m))
ALLOCATE (hpsi( npwx*npol , m))
ALLOCATE (spsi( npwx*npol , m))
......@@ -111,8 +109,6 @@ SUBROUTINE ch_psi_all (n, h, ah, e, ik, m)
DEALLOCATE (hpsi)
DEALLOCATE (ps)
dffts%have_task_groups=.FALSE.
CALL stop_clock ('last')
CALL stop_clock ('ch_psi')
RETURN
......
......@@ -56,8 +56,6 @@ subroutine incdrhoscf (drhoscf, weight, ik, dbecsum, dpsi)
CALL start_clock ('incdrhoscf')
!
IF (ntask_groups > 1) dffts%have_task_groups=.TRUE.
!
ALLOCATE(dpsic(dffts%nnr))
ALLOCATE(psi(dffts%nnr))
!
......@@ -68,7 +66,7 @@ subroutine incdrhoscf (drhoscf, weight, ik, dbecsum, dpsi)
npwq= ngk(ikq)
incr = 1
!
IF (dffts%have_task_groups) THEN
IF ( dtgs%have_task_groups ) THEN
!
v_siz = dtgs%tg_nnr * dtgs%nogrp
!
......@@ -85,7 +83,7 @@ subroutine incdrhoscf (drhoscf, weight, ik, dbecsum, dpsi)
!
do ibnd = 1, nbnd_occ(ikk), incr
!
IF (dffts%have_task_groups) THEN
IF ( dtgs%have_task_groups ) THEN
!
tg_drho=(0.0_DP, 0.0_DP)
tg_psi=(0.0_DP, 0.0_DP)
......@@ -176,12 +174,11 @@ subroutine incdrhoscf (drhoscf, weight, ik, dbecsum, dpsi)
DEALLOCATE(psi)
DEALLOCATE(dpsic)
!
IF (dffts%have_task_groups) THEN
IF ( dtgs%have_task_groups ) THEN
DEALLOCATE(tg_psi)
DEALLOCATE(tg_dpsi)
DEALLOCATE(tg_drho)
ENDIF
dffts%have_task_groups=.FALSE.
!
CALL stop_clock ('incdrhoscf')
!
......
......@@ -60,8 +60,6 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
!
CALL start_clock ('incdrhoscf')
!
IF (ntask_groups > 1 ) dffts%have_task_groups=.TRUE.
!
ALLOCATE (dpsic(dffts%nnr, npol))
ALLOCATE (psi (dffts%nnr, npol))
!
......@@ -72,7 +70,7 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
npwq= ngk(ikq)
incr = 1
!
IF (dffts%have_task_groups) THEN
IF (dtgs%have_task_groups) THEN
!
v_siz = dtgs%tg_nnr * dtgs%nogrp
!
......@@ -89,7 +87,7 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
!
do ibnd = 1, nbnd_occ(ikk), incr
IF (dffts%have_task_groups) THEN
IF (dtgs%have_task_groups) THEN
!
tg_drho=(0.0_DP, 0.0_DP)
tg_psi=(0.0_DP, 0.0_DP)
......@@ -214,12 +212,11 @@ subroutine incdrhoscf_nc (drhoscf, weight, ik, dbecsum, dpsi)
DEALLOCATE(psi)
DEALLOCATE(dpsic)
!
IF (dffts%have_task_groups) THEN
IF (dtgs%have_task_groups) THEN
DEALLOCATE(tg_psi)
DEALLOCATE(tg_dpsi)
DEALLOCATE(tg_drho)
END IF
dffts%have_task_groups=.FALSE.
!
CALL stop_clock ('incdrhoscf')
!
......
......@@ -143,8 +143,6 @@ SUBROUTINE d3_readin()
IF (noncolin) call errore('d3_readin', &
'd3 is not working in the noncolinear case', 1)
!
IF (ntask_groups > 1) dffts%have_task_groups=.FALSE.
!
! band group not available
!
IF (nbgrp /=1 ) &
......
......@@ -96,10 +96,6 @@ SUBROUTINE cg_readin()
IF ( llondon ) CALL errore('cg_readin', &
'phonons with DFT-D not implemented',1)
!
! Task groups not used.
!
IF (ntask_groups > 1) dffts%have_task_groups=.FALSE.
!
! band group not available
!
IF (nbgrp /=1 ) &
......
......@@ -63,12 +63,8 @@ subroutine dvqpsi_us (ik, uact, addnlcc)
complex(DP) , allocatable, target :: aux (:)
complex(DP) , allocatable :: aux1 (:), aux2 (:)
complex(DP) , pointer :: auxs (:)
! work space
logical :: htg
call start_clock ('dvqpsi_us')
htg = dffts%have_task_groups
dffts%have_task_groups=.FALSE.
if (nlcc_any.and.addnlcc) then
allocate (aux( dfftp%nnr))
if (doublegrid) then
......@@ -209,7 +205,6 @@ subroutine dvqpsi_us (ik, uact, addnlcc)
!
call dvqpsi_us_only (ik, uact)
dffts%have_task_groups=htg
call stop_clock ('dvqpsi_us')
return
end subroutine dvqpsi_us
......@@ -310,7 +310,6 @@ SUBROUTINE elphel (irr, npe, imode0, dvscfins)
COMPLEX(DP), EXTERNAL :: zdotc
!
IF (.NOT. comp_elph(irr) .OR. done_elph(irr)) RETURN
IF ( ntask_groups > 1 ) dffts%have_task_groups=.TRUE.
ALLOCATE (aux1 (dffts%nnr, npol))
ALLOCATE (elphmat ( nbnd , nbnd , npe))
......@@ -318,7 +317,7 @@ SUBROUTINE elphel (irr, npe, imode0, dvscfins)
el_ph_mat_rec=(0.0_DP,0.0_DP)
ALLOCATE (aux2(npwx*npol, nbnd))
incr=1
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
!
v_siz = dtgs%tg_nnr * dtgs%nogrp
ALLOCATE( tg_dv ( v_siz, nspin_mag ) )
......@@ -370,8 +369,7 @@ SUBROUTINE elphel (irr, npe, imode0, dvscfins)
!
! calculate dvscf_q*psi_k
!
IF ( ntask_groups > 1 ) dffts%have_task_groups=.TRUE.
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
IF (noncolin) THEN
CALL tg_cgather( dffts, dtgs, dvscfins(:,1,ipert), tg_dv(:,1))
IF (domag) THEN
......@@ -387,7 +385,7 @@ SUBROUTINE elphel (irr, npe, imode0, dvscfins)
ENDIF
aux2=(0.0_DP,0.0_DP)
DO ibnd = 1, nbnd, incr
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
CALL cft_wave_tg (ik, evc, tg_psic, 1, v_siz, ibnd, nbnd )
CALL apply_dpot(v_siz, tg_psic, tg_dv, 1)
CALL cft_wave_tg (ik, aux2, tg_psic, -1, v_siz, ibnd, nbnd)
......@@ -398,7 +396,6 @@ SUBROUTINE elphel (irr, npe, imode0, dvscfins)
ENDIF
ENDDO
dvpsi=dvpsi+aux2
dffts%have_task_groups=.FALSE.
CALL adddvscf (ipert, ik)
!
......@@ -443,12 +440,10 @@ SUBROUTINE elphel (irr, npe, imode0, dvscfins)
DEALLOCATE (elphmat)
DEALLOCATE (aux1)
DEALLOCATE (aux2)
IF ( ntask_groups > 1) dffts%have_task_groups=.TRUE.
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
DEALLOCATE( tg_dv )
DEALLOCATE( tg_psic )
ENDIF
dffts%have_task_groups=.FALSE.
!
RETURN
END SUBROUTINE elphel
......
......@@ -668,10 +668,6 @@ SUBROUTINE phq_readin()
CALL errore('phq_readin',&
'pw.x run with a different number of pools. Use wf_collect=.true.',1)
!
! Task groups not used in phonon. Activated only in some places
!
IF (ntask_groups > 1) dffts%have_task_groups=.FALSE.
IF (nproc_bgrp_file /= nproc_bgrp .AND. .NOT. twfcollect) &
CALL errore('phq_readin','pw.x run with different band parallelization',1)
......
......@@ -114,12 +114,6 @@ SUBROUTINE run_nscf(do_band, iq)
bands_computed=.TRUE.
!
! PWscf has run with task groups if available, but in the phonon
! they are not used, apart in particular points, where they are
! activated.
!
IF (ntask_groups > 1) dffts%have_task_groups=.FALSE.
!
CALL stop_clock( 'PWSCF' )
!
RETURN
......
......@@ -104,8 +104,6 @@ subroutine solve_e
!
! This routine is task group aware
!
IF ( ntask_groups > 1 ) dffts%have_task_groups=.TRUE.
allocate (dvscfin( dfftp%nnr, nspin_mag, 3))
if (doublegrid) then
allocate (dvscfins(dffts%nnr, nspin_mag, 3))
......@@ -141,7 +139,7 @@ subroutine solve_e
iter0 = 0
endif
incr=1
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
!
v_siz = dtgs%tg_nnr * dtgs%nogrp
ALLOCATE( tg_dv ( v_siz, nspin_mag ) )
......@@ -209,8 +207,7 @@ subroutine solve_e
! calculates dvscf_q*psi_k in G_space, for all bands, k=kpoint
! dvscf_q from previous iteration (mix_potential)
!
IF ( ntask_groups > 1) dffts%have_task_groups=.TRUE.
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
IF (noncolin) THEN
CALL tg_cgather( dffts, dtgs, dvscfins(:,1,ipol), &
tg_dv(:,1))
......@@ -227,7 +224,7 @@ subroutine solve_e
ENDIF
aux2=(0.0_DP,0.0_DP)
do ibnd = 1, nbnd_occ (ik), incr
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
call cft_wave_tg (ik, evc, tg_psic, 1, v_siz, ibnd, &
nbnd_occ (ik) )
call apply_dpot(v_siz, tg_psic, tg_dv, 1)
......@@ -429,14 +426,12 @@ subroutine solve_e
deallocate (dvscfin)
if (noncolin) deallocate(dbecsum_nc)
deallocate(aux2)
IF ( ntask_groups > 1 ) dffts%have_task_groups=.TRUE.
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
!
DEALLOCATE( tg_dv )
DEALLOCATE( tg_psic)
!
ENDIF
dffts%have_task_groups=.FALSE.
call stop_clock ('solve_e')
return
......
......@@ -149,8 +149,6 @@ SUBROUTINE solve_linter (irr, imode0, npe, drhoscf)
!
! This routine is task group aware
!
IF ( ntask_groups > 1 ) dffts%have_task_groups=.TRUE.
allocate (dvscfin ( dfftp%nnr , nspin_mag , npe))
if (doublegrid) then
allocate (dvscfins (dffts%nnr , nspin_mag , npe))
......@@ -171,7 +169,7 @@ SUBROUTINE solve_linter (irr, imode0, npe, drhoscf)
allocate (aux2(npwx*npol, nbnd))
allocate (drhoc(dfftp%nnr))
incr=1
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
!
v_siz = dtgs%tg_nnr * dtgs%nogrp
ALLOCATE( tg_dv ( v_siz, nspin_mag ) )
......@@ -287,8 +285,7 @@ SUBROUTINE solve_linter (irr, imode0, npe, drhoscf)
! dvscf_q from previous iteration (mix_potential)
!
call start_clock ('vpsifft')
IF ( ntask_groups > 1 ) dffts%have_task_groups=.TRUE.
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
IF (noncolin) THEN
CALL tg_cgather( dffts, dtgs, dvscfins(:,1,ipert), &
tg_dv(:,1))
......@@ -305,7 +302,7 @@ SUBROUTINE solve_linter (irr, imode0, npe, drhoscf)
ENDIF
aux2=(0.0_DP,0.0_DP)
do ibnd = 1, nbnd_occ (ikk), incr
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
call cft_wave_tg (ik, evc, tg_psic, 1, v_siz, ibnd, &
nbnd_occ (ikk) )
call apply_dpot(v_siz, tg_psic, tg_dv, 1)
......@@ -318,7 +315,6 @@ SUBROUTINE solve_linter (irr, imode0, npe, drhoscf)
ENDIF
enddo
dvpsi=dvpsi+aux2
dffts%have_task_groups=.FALSE.
call stop_clock ('vpsifft')
!
! In the case of US pseudopotentials there is an additional
......@@ -604,12 +600,10 @@ SUBROUTINE solve_linter (irr, imode0, npe, drhoscf)
deallocate (dvscfin)
deallocate(aux2)
deallocate(drhoc)
IF ( ntask_groups > 1) dffts%have_task_groups=.TRUE.
IF ( dffts%have_task_groups ) THEN
IF ( dtgs%have_task_groups ) THEN
DEALLOCATE( tg_dv )
DEALLOCATE( tg_psic )
ENDIF
dffts%have_task_groups=.FALSE.
call stop_clock ('solve_linter')
END SUBROUTINE solve_linter
......
......@@ -125,7 +125,7 @@ SUBROUTINE h_psi_( lda, n, m, psi, hpsi )
! ... real-space algorithm
! ... fixme: real_space without beta functions does not make sense
!
IF ( dffts%have_task_groups .AND. ( m >= dtgs%nogrp )) then
IF ( dtgs%have_task_groups .AND. ( m >= dtgs%nogrp )) then
incr = 2 * dtgs%nogrp
ELSE
incr = 2
......
......@@ -22,7 +22,7 @@ SUBROUTINE init_run()
USE paw_init, ONLY : paw_post_init
#endif
USE bp, ONLY : allocate_bp_efield, bp_global_map
USE fft_base, ONLY : dffts
USE fft_base, ONLY : dffts, dtgs
USE funct, ONLY : dft_is_hybrid
USE recvec_subs, ONLY : ggen
USE wannier_new, ONLY : use_wannier
......@@ -46,7 +46,7 @@ SUBROUTINE init_run()
!
CALL allocate_fft()
!
IF ( dft_is_hybrid() .AND. dffts%have_task_groups ) &
IF ( dft_is_hybrid() .AND. dtgs%have_task_groups ) &
CALL errore ('init_run', '-ntg option incompatible with EXX',1)
!
! ... generate reciprocal-lattice vectors and fft indices
......
......@@ -120,7 +120,7 @@ MODULE realus
!real space, allocation for task group fft work arrays
IF( dffts%have_task_groups ) THEN
IF( dtgs%have_task_groups ) THEN
!
IF (allocated( tg_psic ) ) DEALLOCATE( tg_psic )
!
......@@ -1313,7 +1313,7 @@ MODULE realus
!
CALL start_clock( 'calbec_rs' )
!
IF( ( dffts%have_task_groups ) .and. ( last >= dtgs%nogrp ) ) THEN
IF( ( dtgs%have_task_groups ) .and. ( last >= dtgs%nogrp ) ) THEN
CALL errore( 'calbec_rs_gamma', 'task_groups not implemented', 1 )
......@@ -1416,7 +1416,7 @@ MODULE realus
!
CALL start_clock( 'calbec_rs' )
!
IF( ( dffts%have_task_groups ) .and. ( last >= dtgs%nogrp ) ) THEN
IF( ( dtgs%have_task_groups ) .and. ( last >= dtgs%nogrp ) ) THEN
CALL errore( 'calbec_rs_k', 'task_groups not implemented', 1 )
......@@ -1495,7 +1495,7 @@ MODULE realus
REAL(DP), EXTERNAL :: ddot
!
CALL start_clock( 's_psir' )
IF( ( dffts%have_task_groups ) .and. ( last >= dtgs%nogrp ) ) THEN
IF( ( dtgs%have_task_groups ) .and. ( last >= dtgs%nogrp ) ) THEN
CALL errore( 's_psir_gamma', 'task_groups not implemented', 1 )
ELSE
! non task groups part starts here
......@@ -1580,7 +1580,7 @@ MODULE realus
!
CALL start_clock( 's_psir' )
IF( ( dffts%have_task_groups ) .and. ( last >= dtgs%nogrp ) ) THEN
IF( ( dtgs%have_task_groups ) .and. ( last >= dtgs%nogrp ) ) THEN
CALL errore( 's_psir_k', 'task_groups not implemented', 1 )
ELSE
!non task groups part starts here<