Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Covariant dipoles in tech-master broken on GPUs after last changes #106

Open
sangallidavide opened this issue Jul 6, 2024 · 3 comments
Open
Assignees

Comments

@sangallidavide
Copy link
Member

Below the changes which are buggy with CUDAF.
Probably due to slicing of wave-functions

-     call WF_symm_kpoint((/1,Dip%ib(2)/),ikbz,Xk,WF_symm)
-     !  
-     call WF_shift_kpoint((/1,Dip%ib(2)/),ikbz,WF_shifts(ikbz,:),Xk,WF_symm,WF_ik)
+     do ib=1,Dip%ib(2)
+       !
+       call WF_symm_kpoint((/ib,ib/),ikbz,Xk,WF_symm)
+       !  
+       call WF_shift_kpoint((/ib,ib/),ikbz,WF_shifts(ikbz,:),Xk,WF_symm,WF_ik(:,:,ib:ib,:))
+       !
+     enddo

and

-         call WF_shift_kpoint((/1,Dip%ib(2)/),ikbzp,shift,Xk,WF_symm,WF_ikp)
-         !
-         call WF_free(WF)
-         !
-         do ib=1,Dip%ib(2)
-           if(.not.PAR_IND_VAL_BANDS_OVLP%element_1D(ib)) cycle
-           do ibp=1,Dip%ib(2)
-             if(.not.PAR_IND_CON_BANDS_OVLP%element_1D(ibp)) cycle
+         do ibp=1,Dip%ib(2) 
+           if(.not.PAR_IND_CON_BANDS_OVLP%element_1D(ibp)) cycle
+           call WF_symm_kpoint((/ibp,ibp/),ikbzp,Xk,WF_symm)
+           call WF_shift_kpoint((/ibp,ibp/),ikbzp,shift,Xk,WF_symm,WF_ikp)
+           do ib=1,Dip%ib(2)
+             if(.not.PAR_IND_VAL_BANDS_OVLP%element_1D(ib)) cycle
              DIP_S(ib,ibp,id+(istep-1)*3,ikbz,i_sp_pol)= &
-             &  Vstar_dot_V(wf_ng_overlaps*n_spinor,WF_ik(:,:,ib,i_sp_pol),WF_ikp(:,:,ibp,i_sp_pol))
+             &  Vstar_dot_V(wf_ng_overlaps*n_spinor,WF_ik(:,:,ib,i_sp_pol),WF_ikp(:,:,1,i_sp_pol))
            enddo ! ibp
          enddo ! ib
sangallidavide added a commit to sangallidavide/yambo that referenced this issue Jul 6, 2024
MODIFIED *  include/version/version.m4 dipoles/DIPOLE_overlaps.F modules/mod_interfaces.F wf_and_fft/WF_shift_kpoint.F wf_and_fft/WF_symm_kpoint.F

Bugs:
- [yambo] Fixed covariant dipoles with CUDA (issue yambo-code#106)

Patch sent by:  Davide Sangalli <[email protected]>
@sangallidavide
Copy link
Member Author

sangallidavide commented Jul 6, 2024

Fixed in branch tech-bse presently under pull request with commit 092f32e

@attacc
Copy link
Contributor

attacc commented Jul 7, 2024

Thank you

@palful
Copy link
Member

palful commented Jul 8, 2024

The covariant dipoles on GPU were also not working for us (but since forever, not just due to recent changes). If this change works then it's very convenient also for the GW@DFT+U part!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants