Fix all ph_base/ tests (kpoints case fixed)

This commit is contained in:
Ivan Carnimeo 2024-04-18 14:17:04 +02:00
parent ecf7e0c845
commit 7426538d9c
4 changed files with 6 additions and 0 deletions

View File

@ -170,12 +170,15 @@ SUBROUTINE sternheimer_kernel(first_iter, time_reversed, npert, lrdvpsi, iudvpsi
!
IF (nksq > 1 .OR. (noncolin .AND. domag)) THEN
IF (lgamma) THEN
!civn: in this case evq is a pointer to evc
CALL get_buffer(evc, lrwfc, iuwfc, ikmk)
!$acc update device(evc)
ELSE
!civn: in this case evq is allocated separately and needs to be updated on device
CALL get_buffer(evc, lrwfc, iuwfc, ikmk)
!$acc update device(evc)
CALL get_buffer(evq, lrwfc, iuwfc, ikmkmq)
!$acc update device(evq)
ENDIF
ENDIF
!

View File

@ -63,6 +63,7 @@ subroutine allocate_phq
! q!=0 : evq is allocated and calculated at point k+q
!
allocate (evq ( npwx*npol , nbnd))
!$acc enter data create(evq)
endif
!
allocate (dvpsi ( npwx*npol , nbnd))

View File

@ -54,6 +54,7 @@ subroutine deallocate_phq
if (lgamma) then
if(associated(evq)) nullify(evq)
else
!$acc exit data delete(evq)
if(associated(evq)) deallocate(evq) !why not if allocated?
end if

View File

@ -267,6 +267,7 @@ SUBROUTINE solve_linter (irr, imode0, npe, drhoscf)
!
IF (nksq > 1 .OR. nsolv == 2) THEN
CALL get_buffer(evc, lrwfc, iuwfc, ikmk)
!$acc update device(evc)
ENDIF
!
DO ipert = 1, npe