Skip to content

Commit

Permalink
Made phase calculation in V2 more space conscious.
Browse files Browse the repository at this point in the history
  • Loading branch information
nakib committed Jul 31, 2024
1 parent b26554d commit b4da5a6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/interactions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ subroutine calculate_3ph_interaction(ph, crys, num, key)
real(r64), allocatable :: Vm2_1(:), Vm2_2(:), Wm(:), Wp(:)
integer(i64), allocatable :: istate2_plus(:), istate3_plus(:), istate2_minus(:), istate3_minus(:)
integer(i64), allocatable :: chunk[:], start[:], end[:]
complex(r64) :: phases_q1(ph%numtriplets, ph%nwv)
complex(r64) :: phases(ph%numtriplets) !phases_q1(ph%numtriplets, ph%nwv)
character(len = 1024) :: filename, filename_Wm, filename_Wp
logical :: tetrahedra_gpu
logical, allocatable :: minus_mask(:), plus_mask(:)
Expand Down Expand Up @@ -667,7 +667,10 @@ subroutine calculate_3ph_interaction(ph, crys, num, key)
q2_cart = matmul(reclattvecs, q2)
q3_minus_cart = matmul(reclattvecs, q3_minus)
do it = 1, ntrips_gpu
phases_q1(it, iq2) = &
!!$ phases_q1(it, iq2) = &
!!$ expi(-dot_product(q2_cart, (R_j(:, it))) &
!!$ -dot_product(q3_minus_cart, (R_k(:, it))))
phases(it) = &
expi(-dot_product(q2_cart, (R_j(:, it))) &
-dot_product(q3_minus_cart, (R_k(:, it))))
end do
Expand Down Expand Up @@ -712,11 +715,17 @@ subroutine calculate_3ph_interaction(ph, crys, num, key)

if(en1*en2*en3 == 0.0_r64) cycle

!!$ if(delta_minus > 0.0_r64 .or. delta_plus > 0.0_r64) &
!!$ aux = Vm2_3ph(evecs(iq1, s1, :), &
!!$ evecs(iq2, s2, :), evecs(iq3_minus, s3, :), &
!!$ Index_i(:), Index_j(:), Index_k(:), ifc3(:,:,:,:), &
!!$ phases_q1(:, iq2), ntrips_gpu, nbands_gpu)

if(delta_minus > 0.0_r64 .or. delta_plus > 0.0_r64) &
aux = Vm2_3ph(evecs(iq1, s1, :), &
evecs(iq2, s2, :), evecs(iq3_minus, s3, :), &
Index_i(:), Index_j(:), Index_k(:), ifc3(:,:,:,:), &
phases_q1(:, iq2), ntrips_gpu, nbands_gpu)
phases(:), ntrips_gpu, nbands_gpu)

if(delta_minus > 0.0_r64) then
!Record energetically available minus process
Expand Down

0 comments on commit b4da5a6

Please sign in to comment.