9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 19:13:29 +01:00

Accelerate H Psi when c_i=0

This commit is contained in:
Anthony Scemama 2021-01-04 22:15:46 +01:00
parent b4fce4c594
commit 8953f052b4
2 changed files with 26 additions and 3 deletions

View File

@ -32,7 +32,7 @@ OPENMP : 1 ; Append OpenMP flags
# #
[OPT] [OPT]
FC : -traceback FC : -traceback
FCFLAGS : -mavx -O2 -ip -ftz -g FCFLAGS : -xAVX -O2 -ip -ftz -g
# Profiling flags # Profiling flags
################# #################

View File

@ -250,7 +250,7 @@ compute_singles=.True.
!$OMP singles_beta_csc,singles_beta_csc_idx) & !$OMP singles_beta_csc,singles_beta_csc_idx) &
!$OMP PRIVATE(krow, kcol, tmp_det, spindet, k_a, k_b, i, & !$OMP PRIVATE(krow, kcol, tmp_det, spindet, k_a, k_b, i, &
!$OMP lcol, lrow, l_a, l_b, utl, kk, & !$OMP lcol, lrow, l_a, l_b, utl, kk, &
!$OMP buffer, doubles, n_doubles, & !$OMP buffer, doubles, n_doubles, umax, &
!$OMP tmp_det2, hij, sij, idx, l, kcol_prev, & !$OMP tmp_det2, hij, sij, idx, l, kcol_prev, &
!$OMP singles_a, n_singles_a, singles_b, ratio, & !$OMP singles_a, n_singles_a, singles_b, ratio, &
!$OMP n_singles_b, k8, last_found,left,right,right_max) !$OMP n_singles_b, k8, last_found,left,right,right_max)
@ -399,8 +399,11 @@ compute_singles=.True.
! Loop over alpha singles ! Loop over alpha singles
! ----------------------- ! -----------------------
double precision :: umax
!DIR$ LOOP COUNT avg(1000) !DIR$ LOOP COUNT avg(1000)
do k = 1,n_singles_a,block_size do k = 1,n_singles_a,block_size
umax = 0.d0
! Prefetch u_t(:,l_a) ! Prefetch u_t(:,l_a)
do kk=0,block_size-1 do kk=0,block_size-1
if (k+kk > n_singles_a) exit if (k+kk > n_singles_a) exit
@ -409,8 +412,10 @@ compute_singles=.True.
do l=1,N_st do l=1,N_st
utl(l,kk+1) = u_t(l,l_a) utl(l,kk+1) = u_t(l,l_a)
umax = max(umax, dabs(utl(l,kk+1)))
enddo enddo
enddo enddo
if (umax < 1.d-20) cycle
do kk=0,block_size-1 do kk=0,block_size-1
if (k+kk > n_singles_a) exit if (k+kk > n_singles_a) exit
@ -490,6 +495,7 @@ compute_singles=.True.
tmp_det2(1:$N_int,2) = psi_det_beta_unique (1:$N_int, kcol) tmp_det2(1:$N_int,2) = psi_det_beta_unique (1:$N_int, kcol)
!DIR$ LOOP COUNT avg(1000) !DIR$ LOOP COUNT avg(1000)
do i=1,n_singles_a,block_size do i=1,n_singles_a,block_size
umax = 0.d0
! Prefetch u_t(:,l_a) ! Prefetch u_t(:,l_a)
do kk=0,block_size-1 do kk=0,block_size-1
if (i+kk > n_singles_a) exit if (i+kk > n_singles_a) exit
@ -498,8 +504,10 @@ compute_singles=.True.
do l=1,N_st do l=1,N_st
utl(l,kk+1) = u_t(l,l_a) utl(l,kk+1) = u_t(l,l_a)
umax = max(umax, dabs(utl(l,kk+1)))
enddo enddo
enddo enddo
if (umax < 1.d-20) cycle
do kk=0,block_size-1 do kk=0,block_size-1
if (i+kk > n_singles_a) exit if (i+kk > n_singles_a) exit
@ -524,6 +532,7 @@ compute_singles=.True.
!DIR$ LOOP COUNT avg(50000) !DIR$ LOOP COUNT avg(50000)
do i=1,n_doubles,block_size do i=1,n_doubles,block_size
umax = 0.d0
! Prefetch u_t(:,l_a) ! Prefetch u_t(:,l_a)
do kk=0,block_size-1 do kk=0,block_size-1
if (i+kk > n_doubles) exit if (i+kk > n_doubles) exit
@ -532,8 +541,10 @@ compute_singles=.True.
do l=1,N_st do l=1,N_st
utl(l,kk+1) = u_t(l,l_a) utl(l,kk+1) = u_t(l,l_a)
umax = max(umax, dabs(utl(l,kk+1)))
enddo enddo
enddo enddo
if (umax < 1.d-20) cycle
do kk=0,block_size-1 do kk=0,block_size-1
if (i+kk > n_doubles) exit if (i+kk > n_doubles) exit
@ -599,6 +610,7 @@ compute_singles=.True.
tmp_det2(1:$N_int,1) = psi_det_alpha_unique(1:$N_int, krow) tmp_det2(1:$N_int,1) = psi_det_alpha_unique(1:$N_int, krow)
!DIR$ LOOP COUNT avg(1000) !DIR$ LOOP COUNT avg(1000)
do i=1,n_singles_b,block_size do i=1,n_singles_b,block_size
umax = 0.d0
do kk=0,block_size-1 do kk=0,block_size-1
if (i+kk > n_singles_b) exit if (i+kk > n_singles_b) exit
l_b = singles_b(i+kk) l_b = singles_b(i+kk)
@ -609,8 +621,10 @@ compute_singles=.True.
do l=1,N_st do l=1,N_st
utl(l,kk+1) = u_t(l,l_a) utl(l,kk+1) = u_t(l,l_a)
umax = max(umax, dabs(utl(l,kk+1)))
enddo enddo
enddo enddo
if (umax < 1.d-20) cycle
do kk=0,block_size-1 do kk=0,block_size-1
if (i+kk > n_singles_b) exit if (i+kk > n_singles_b) exit
@ -634,6 +648,7 @@ compute_singles=.True.
!DIR$ LOOP COUNT avg(50000) !DIR$ LOOP COUNT avg(50000)
do i=1,n_doubles,block_size do i=1,n_doubles,block_size
umax = 0.d0
do kk=0,block_size-1 do kk=0,block_size-1
if (i+kk > n_doubles) exit if (i+kk > n_doubles) exit
l_b = doubles(i+kk) l_b = doubles(i+kk)
@ -643,8 +658,10 @@ compute_singles=.True.
do l=1,N_st do l=1,N_st
utl(l,kk+1) = u_t(l,l_a) utl(l,kk+1) = u_t(l,l_a)
umax = max(umax, dabs(utl(l,kk+1)))
enddo enddo
enddo enddo
if (umax < 1.d-20) cycle
do kk=0,block_size-1 do kk=0,block_size-1
if (i+kk > n_doubles) exit if (i+kk > n_doubles) exit
@ -671,6 +688,12 @@ compute_singles=.True.
! Initial determinant is at k_a in alpha-major representation ! Initial determinant is at k_a in alpha-major representation
! ----------------------------------------------------------------------- ! -----------------------------------------------------------------------
umax = 0.d0
do l=1,N_st
umax = max(umax, dabs(u_t(l,k_a)))
enddo
if (umax < 1.d-20) cycle
krow = psi_bilinear_matrix_rows(k_a) krow = psi_bilinear_matrix_rows(k_a)
ASSERT (krow <= N_det_alpha_unique) ASSERT (krow <= N_det_alpha_unique)