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

Small optimizations

This commit is contained in:
Anthony Scemama 2021-03-24 16:57:08 +01:00
parent 6683245273
commit 7033d61850
2 changed files with 16 additions and 8 deletions

View File

@ -781,6 +781,7 @@ subroutine calculate_preconditioner_cfg(diag_energies)
real*8 :: meCC
real*8 :: ecore
PROVIDE h_core_ri
! initialize energies
diag_energies = 0.d0
@ -929,6 +930,8 @@ subroutine obtain_connected_I_foralpha_fromfilterdlist(idxI, nconnectedJ, idslis
integer :: Nsomo_alpha
logical :: isOKlistJ
PROVIDE DetToCSFTransformationMatrix
isOKlistJ = .False.
nconnectedI = 0
@ -1441,7 +1444,6 @@ subroutine calculate_sigma_vector_cfg_nst_naive_store(psi_out, psi_in, n_st, sze
cnti = ii-starti+1
do jj = startj, endj
cntj = jj-startj+1
!meCC1 = AIJpqContainer(NSOMOI,extype,pmodel,qmodel,cnti,cntj)
meCC1 = AIJpqContainer(cnti,cntj,pmodel,qmodel,extype,NSOMOI)* h_core_ri(p,q)
call omp_set_lock(lock(jj))
do kk = 1,n_st
@ -1629,18 +1631,24 @@ subroutine calculate_sigma_vector_cfg_nst_naive_store(psi_out, psi_in, n_st, sze
! Add the diagonal contribution
!$OMP DO
do kk=1,n_st
do i = 1,n_CSF
do kk=1,n_st
psi_out(kk,i) += diag_energies(i)*psi_in(kk,i)
enddo
enddo
enddo
!$OMP END DO
!$OMP end parallel
!$OMP END PARALLEL
call omp_set_max_active_levels(4)
deallocate(diag_energies)
deallocate(bit_tmp)
end subroutine calculate_sigma_vector_cfg_nst_naive_store
subroutine calculate_sigma_vector_cfg_nst(psi_out, psi_in, n_st, sze, istart, iend, ishift, istep)
implicit none
use bitmasks

View File

@ -266,10 +266,10 @@ subroutine davidson_diag_csf_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,sze_csf,N
do k=N_st+1,N_st_diag
do i=1,sze
!call random_number(r1)
!call random_number(r2)
r1 = 0.5
r2 = 0.5
call random_number(r1)
call random_number(r2)
!r1 = 0.5
!r2 = 0.5
r1 = dsqrt(-2.d0*dlog(r1))
r2 = dtwo_pi*r2
u_in(i,k) = r1*dcos(r2) * u_in(i,k-N_st)