[Pw_forum] Bug report (QE 6.1): Hybrid functional + Gamma-trick

Paolo Giannozzi p.giannozzi at gmail.com
Wed Mar 22 13:45:54 CET 2017


I am 100% sure that this bug was fixed in rev.13158, Nov.17 (see
attached patch). Maybe it was re-introduced with subsequent changes.

Paolo

On Wed, Mar 22, 2017 at 1:06 PM, Hosung Seo <hseo at uchicago.edu> wrote:
> Dear QE developers,
>
> It seems like there is a bug in quantum espresso 6.1 for the following
> combination: (1) hybrid functional + (2) gamma-trick + (3) spin polarization
> + (4) npool of 2.
>
> With this combination, the calculation crashes right after the first PBE
> calculation. I haven’t tested the (3) and (4) parts thoroughly, but the
> problem goes away if I turn off the gamma-trick.
>
> The calculations have been done using a local linux cluster at the
> University of Chicago compiled with mkl and intelmpi.
>
> The following is two examples to reproduce the error.
>
> 1. SrTiO3: 5-atom cubic unit cell.
>
> &CONTROL
> calculation = 'scf'
> restart_mode = 'from_scratch'
> prefix = 'SrTiO3'
> pseudo_dir = '/home/hseo/Quantum_Espresso/Pseudo/ONCV/UPF/'
> outdir = './out/'
> wf_collect = .true.
> tprnfor = .true.
> verbosity = 'high'
> /
> &SYSTEM
> ibrav = 0, celldm(1) = 1.889726164
> nat = 5
> ntyp = 3
> ecutwfc = 80
> nosym = .FALSE.
> occupations = ‘from_input'
> nspin = 2
> nbnd = 24
> input_dft = 'pbe0', nqx1 = 1, nqx2 = 1, nqx3 = 1,
> exx_fraction = 0.25
> exxdiv_treatment = 'gygi-baldereschi'
> ecutfock = 160
> /
> &ELECTRONS
> electron_maxstep = 400
> conv_thr = 1.0d-6
> mixing_mode = 'plain'
> mixing_beta = 0.7
> diagonalization = 'david'
> startingpot = 'atomic'
> startingwfc = 'atomic+random'
> /
> ATOMIC_SPECIES
> Sr 87.6200 Sr_ONCV_PBE-1.0.upf
> Ti 47.8670 Ti_ONCV_PBE-1.0.upf
> O  13.6181  O_ONCV_PBE-1.0.upf
> CELL_PARAMETERS alat
> 3.9  0.000000000  0.000000000
> 0.0000000000  3.9  0.000000000
> 0.0000000000  0.000000000  3.9
> K_POINTS gamma
> OCCUPATIONS
>      1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000
>      1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000
>      1.0000   1.0000   1.0000   1.0000   0.0000   0.0000   0.0000   0.0000
>      1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000
>      1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000
>      1.0000   1.0000   1.0000   1.0000   0.0000   0.0000   0.0000   0.0000
> ATOMIC_POSITIONS (crystal)
> Sr 0.000000 0.000000 0.000000
> Ti 0.500000 0.500000 0.500000
> O 0.500000 0.000000 0.500000
> O 0.500000 0.500000 0.000000
> O 0.000000 0.500000 0.500000
>
>
> 2. Divacancy defects in 4H-SiC
>
> &CONTROL
> calculation = 'scf'
> restart_mode = 'from_scratch'
> prefix = 'SiC'
> pseudo_dir = '/home/hseo/Quantum_Espresso/Pseudo/ONCV/UPF/'
> outdir = './out/'
> wf_collect = .TRUE.
> tprnfor = .TRUE.
> verbosity = 'high'
> /
> &SYSTEM
> ibrav = 0, celldm(1) = 1.889726164
> nat = 94
> ntyp = 4
> ecutwfc = 75
> !nosym = .FALSE.
> input_dft = 'pbe0', nqx1 = 1, nqx2 = 1, nqx3 = 1,
> exx_fraction = 0.1522
> exxdiv_treatment = 'gygi-baldereschi'
> ecutfock = 150
> occupations = 'fixed'
> tot_charge = 0
> nspin = 2
> tot_magnetization = 2.0
> nbnd = 220
> /
> &ELECTRONS
> electron_maxstep = 600
> conv_thr = 1.0d-6
> mixing_mode = 'plain'
> mixing_beta = 0.7
> diagonalization = 'david'
> /
> ATOMIC_SPECIES
> SI 28.0855 Si_ONCV_PBE-1.1.upf
> C  12.0107 C_ONCV_PBE-1.0.upf
> Si 28.0855 Si_ONCV_PBE-1.1.upf
> c  12.0107 C_ONCV_PBE-1.0.upf
> CELL_PARAMETERS alat
> 9.262424249  0.000000000  0.000000000
> 0.000000000  10.69532627  0.000000000
> 0.000000000  0.000000000  10.08881286
> K_POINTS gamma
> ATOMIC_POSITIONS (crystal)
> SI       0.000000000   0.000124178   0.000702724
> SI       0.000000000   0.500102753   0.001133587
> SI       0.333611965  -0.000436038   0.000922934
> SI       0.334638309   0.500691089   0.001884120
> SI       0.666388035  -0.000436038   0.000922934
> SI       0.665361691   0.500691089   0.001884120
> SI       0.166877869   0.250525229   0.000882846
> SI       0.166831391   0.749906358   0.000846064
> SI       0.500000000   0.250003549   0.000766964
> SI       0.500000000   0.748696359   0.002126364
> SI       0.833122131   0.250525229   0.000882846
> SI       0.833168609   0.749906358   0.000846064
> SI       0.000000000   0.000682516   0.500619609
> SI       0.000000000   0.499361842   0.500435742
> SI       0.334148901  -0.000724078   0.500484174
> SI       0.665851099  -0.000724078   0.500484174
> SI       0.167060791   0.250634939   0.500429611
> SI       0.166103683   0.750398290   0.501116999
> SI       0.500000000   0.249350728   0.501031085
> SI       0.832939209   0.250634939   0.500429611
> SI       0.833896317   0.750398290   0.501116999
> SI       0.166647701   0.083351574   0.249862110
> SI       0.169464599   0.583962130   0.249191958
> SI       0.500000000   0.082576453   0.249707308
> SI       0.833352299   0.083351574   0.249862110
> SI       0.830535401   0.583962130   0.249191958
> SI       0.000000000   0.334153622   0.249534433
> SI       0.000000000   0.833233188   0.249917616
> SI       0.335248397   0.335027706   0.249268766
> SI       0.334435435   0.830837286   0.249233808
> SI       0.664751603   0.335027706   0.249268766
> SI       0.665564565   0.830837286   0.249233808
> SI       0.000000000   0.166885638   0.750867675
> SI       0.000000000   0.666873687   0.751221960
> SI       0.333328800   0.166403846   0.751005507
> SI       0.332665484   0.667080221   0.752275798
> SI       0.666671200   0.166403846   0.751005507
> SI       0.667334516   0.667080221   0.752275798
> SI       0.165978706   0.416410857   0.750772538
> SI       0.166520786   0.916793892   0.751050285
> SI       0.500000000   0.415917582   0.752161749
> SI       0.500000000   0.917230378   0.750826163
> SI       0.834021294   0.416410857   0.750772538
> SI       0.833479214   0.916793892   0.751050285
> C        0.000000000  -0.000155093   0.188251811
> C        0.000000000   0.501216912   0.189060636
> C        0.332582885  -0.000098279   0.188612254
> C        0.667417115  -0.000098279   0.188612254
> C        0.166668064   0.249739014   0.188648821
> C        0.166227868   0.750384658   0.188084126
> C        0.500000000   0.249073268   0.188092335
> C        0.833331936   0.249739014   0.188648821
> C        0.833772132   0.750384658   0.188084126
> C        0.000000000   0.000275527   0.688052668
> C        0.000000000   0.500368856   0.687242995
> C        0.333286706  -0.000363926   0.687609443
> C        0.334307348   0.500558466   0.688686137
> C        0.666713294  -0.000363926   0.687609443
> C        0.665692652   0.500558466   0.688686137
> C        0.166987596   0.250149842   0.687564852
> C        0.166569664   0.750096541   0.688182223
> C        0.500000000   0.249774654   0.688119566
> C        0.500000000   0.748911361   0.688711039
> C        0.833012404   0.250149842   0.687564852
> C        0.833430336   0.750096541   0.688182223
> C        0.167629661   0.083321649   0.438454910
> C        0.169028602   0.584426225   0.438343182
> C        0.500000000   0.082847247   0.438479533
> C        0.832370339   0.083321649   0.438454910
> C        0.830971398   0.584426225   0.438343182
> C        0.000000000   0.333397452   0.438396905
> C        0.000000000   0.833754984   0.438664541
> C        0.336108895   0.335449207   0.438353191
> C        0.334067257   0.830045778   0.438368398
> C        0.663891105   0.335449207   0.438353191
> C        0.665932743   0.830045778   0.438368398
> C        0.000000000   0.166902705   0.938821409
> C        0.000000000   0.666759892   0.938775792
> C        0.333240690   0.166485812   0.938795233
> C        0.333207067   0.666758010   0.938536466
> C        0.666759310   0.166485812   0.938795233
> C        0.666792933   0.666758010   0.938536466
> C        0.166586305   0.416875812   0.937647274
> C        0.166623421   0.916688530   0.938766695
> C        0.500000000   0.416459195   0.938501910
> C        0.500000000   0.916605037   0.937603231
> C        0.833413695   0.416875812   0.937647274
> C        0.833376579   0.916688530   0.938766695
> Si       0.332148161   0.499695149   0.503809749
> Si       0.500000000   0.750255231   0.503715732
> Si       0.667851839   0.499695149   0.503809749
> c        0.322480428   0.494428143   0.183482375
> c        0.677519572   0.494428143   0.183482375
> c        0.500000000   0.760692435   0.183511224
>
> Thank you
>
> Best,
> Hosung Seo
>
>
>
>
>
>
>
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://pwscf.org/mailman/listinfo/pw_forum



-- 
Paolo Giannozzi, Dip. Scienze Matematiche Informatiche e Fisiche,
Univ. Udine, via delle Scienze 208, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222
-------------- next part --------------
--- trunk/espresso/PW/src/exx.f90	2016/11/14 15:20:42	13150
+++ trunk/espresso/PW/src/exx.f90	2016/11/17 06:15:56	13158
@@ -280,7 +280,6 @@
     USE klist,      ONLY : xk, wk, nkstot, nks, qnorm
     USE wvfct,      ONLY : nbnd
     USE start_k,    ONLY : nk1,nk2,nk3
-    USE mp_pools,   ONLY : npool
     USE control_flags, ONLY : iverbosity
     !
     IMPLICIT NONE
@@ -573,7 +572,6 @@
     USE symm_base,  ONLY : s
     USE cell_base,  ONLY : at
     USE klist,      ONLY : nkstot, xk
-    USE mp_pools,   ONLY : npool
     IMPLICIT NONE
     REAL(dp), INTENT(in) :: xk_collect(:,:)
     !
@@ -667,7 +665,6 @@
     USE wvfct,                ONLY : nbnd, npwx, wg, current_k
     USE klist,                ONLY : ngk, nks, nkstot, xk, wk, igk_k
     USE symm_base,            ONLY : nsym, s, sr, ftau
-    USE mp_pools,             ONLY : npool, nproc_pool, me_pool, inter_pool_comm
     USE mp_bands,             ONLY : me_bgrp, set_bgrp_indices, nbgrp
     USE mp,                   ONLY : mp_sum, mp_bcast
     USE funct,                ONLY : get_exx_fraction, start_exx,exx_is_active,&
@@ -678,8 +675,6 @@
     USE us_exx,               ONLY : rotate_becxx
     USE paw_variables,        ONLY : okpaw
     USE paw_exx,              ONLY : PAW_init_fock_kernel
-    USE mp_pools,             ONLY : me_pool, my_pool_id, root_pool, nproc_pool, &
-                                     inter_pool_comm, my_pool_id, intra_pool_comm
     USE mp_orthopools,        ONLY : intra_orthopool_comm
 
     IMPLICIT NONE
@@ -775,8 +770,13 @@
         ibnd_buff_end   = ibnd_end
     ENDIF
     !
-    IF (.not. allocated(exxbuff)) &
-        ALLOCATE( exxbuff(nrxxs*npol, ibnd_buff_start:ibnd_buff_end, nkqs))
+    IF (.not. allocated(exxbuff)) THEN
+       IF (gamma_only) THEN
+          ALLOCATE( exxbuff(nrxxs*npol, ibnd_buff_start:ibnd_buff_end, nks))
+       ELSE
+          ALLOCATE( exxbuff(nrxxs*npol, ibnd_buff_start:ibnd_buff_end, nkqs))
+       END IF
+    END IF
     exxbuff=(0.0_DP,0.0_DP)
     !
     !   This is parallelized over pools. Each pool computes only its k-points
@@ -920,17 +920,23 @@
     ! Each wavefunction in exxbuff is computed by a single pool, collect among 
     ! pools in a smart way (i.e. without doing all-to-all sum and bcast)
     ! See also the initialization of working_pool in exx_mp_init
-!      IF (npool>1 ) CALL mp_sum(exxbuff, inter_pool_comm)
-    DO ikq = 1, nkqs
-      CALL mp_bcast(exxbuff(:,:,ikq), working_pool(ikq), intra_orthopool_comm)
-    ENDDO
+    ! Note that in Gamma-only LSDA can be parallelized over two pools, and there
+    ! is no need to communicate anything: each pools deals with its own spin
+    !
+    IF ( .NOT.gamma_only ) THEN
+       DO ikq = 1, nkqs
+         CALL mp_bcast(exxbuff(:,:,ikq), working_pool(ikq), intra_orthopool_comm)
+       ENDDO
+    END IF
     !
     ! For US/PAW only: compute <beta_I|psi_j,k+q> for the entire 
-    ! de-symmetrized k+q grid by rotating the ones fro mthe irreducible wedge
+    ! de-symmetrized k+q grid by rotating the ones from the irreducible wedge
+    !
     IF(okvan) CALL rotate_becxx(nkqs, index_xk, index_sym, xkq_collect)
     !
     ! Initialize 4-wavefunctions one-center Fock integrals
     !    \int \psi_a(r)\phi_a(r)\phi_b(r')\psi_b(r')/|r-r'|
+    !
     IF(okpaw) CALL PAW_init_fock_kernel()
     !
     IF ( use_ace) CALL aceinit ( )
@@ -1199,13 +1205,13 @@
              IF( mod(im,2) == 0 ) THEN
 !$omp parallel do default(shared), private(ir)
                 DO ir = 1, nrxxs
-                   rhoc(ir) = exxbuff(ir,h_ibnd,ikq) * temppsic_aimag(ir) / omega
+                   rhoc(ir) = exxbuff(ir,h_ibnd,current_k) * temppsic_aimag(ir) / omega
                 ENDDO
 !$omp end parallel do
              ELSE
 !$omp parallel do default(shared), private(ir)
                 DO ir = 1, nrxxs
-                   rhoc(ir) = exxbuff(ir,h_ibnd,ikq) * temppsic_dble(ir) / omega
+                   rhoc(ir) = exxbuff(ir,h_ibnd,current_k) * temppsic_dble(ir) / omega
                 ENDDO
 !$omp end parallel do
              ENDIF
@@ -1279,8 +1285,8 @@
              !
 !$omp parallel do default(shared), private(ir)
              DO ir = 1, nrxxs
-                RESULT(ir) = RESULT(ir)+x1* dble(vc(ir))* dble(exxbuff(ir,h_ibnd,ikq))&
-                                       +x2*aimag(vc(ir))*aimag(exxbuff(ir,h_ibnd,ikq))
+                RESULT(ir) = RESULT(ir)+x1* dble(vc(ir))* dble(exxbuff(ir,h_ibnd,current_k))&
+                                       +x2*aimag(vc(ir))*aimag(exxbuff(ir,h_ibnd,current_k))
              ENDDO
 !$omp end parallel do
              !
@@ -2006,13 +2012,13 @@
                 IF( mod(jbnd,2) == 0 ) THEN
 !$omp parallel do default(shared), private(ir)
                    DO ir = 1, nrxxs
-                      rhoc(ir) = exxbuff(ir,h_ibnd,ikq) * temppsic_aimag(ir) / omega
+                      rhoc(ir) = exxbuff(ir,h_ibnd,ikk) * temppsic_aimag(ir) / omega
                    ENDDO
 !$omp end parallel do
                 ELSE
 !$omp parallel do default(shared), private(ir)
                    DO ir = 1, nrxxs
-                      rhoc(ir) = exxbuff(ir,h_ibnd,ikq) * temppsic_dble(ir) / omega
+                      rhoc(ir) = exxbuff(ir,h_ibnd,ikk) * temppsic_dble(ir) / omega
                    ENDDO
 !$omp end parallel do
                 ENDIF


More information about the users mailing list