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

Improved cholesky

This commit is contained in:
Anthony Scemama 2023-05-26 11:48:08 +02:00
parent 646e187ac9
commit f2ca86ef60
3 changed files with 27 additions and 2 deletions

View File

@ -51,8 +51,9 @@ END_PROVIDER
double precision :: integral double precision :: integral
logical, external :: ao_two_e_integral_zero logical, external :: ao_two_e_integral_zero
!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(i,j,k,l, integral) SCHEDULE(dynamic) !$OMP PARALLEL DEFAULT(SHARED) PRIVATE(i,j,k,l, integral)
do l=1,ao_num do l=1,ao_num
!$OMP DO SCHEDULE(dynamic)
do j=1,l do j=1,l
do k=1,ao_num do k=1,ao_num
do i=1,k do i=1,k
@ -65,8 +66,28 @@ END_PROVIDER
enddo enddo
enddo enddo
enddo enddo
!$OMP END DO NOWAIT
enddo enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL
!$OMP PARALLEL DEFAULT(SHARED) PRIVATE(i,j,k,l, integral)
do l=1,ao_num
!$OMP DO SCHEDULE(dynamic)
do j=1,l
do k=1,ao_num
do i=1,k
if (ao_two_e_integral_zero(i,j,k,l)) cycle
integral = ao_two_e_integral(i,k,j,l)
ao_integrals(i,k,j,l) = integral
ao_integrals(k,i,j,l) = integral
ao_integrals(i,k,l,j) = integral
ao_integrals(k,i,l,j) = integral
enddo
enddo
enddo
!$OMP END DO NOWAIT
enddo
!$OMP END PARALLEL
! Call Lapack ! Call Lapack
cholesky_ao_num = cholesky_ao_num_guess cholesky_ao_num = cholesky_ao_num_guess

View File

@ -76,6 +76,8 @@ subroutine select_connected(i_generator,E0,pt2_data,b,subset,csubset)
double precision, allocatable :: fock_diag_tmp(:,:) double precision, allocatable :: fock_diag_tmp(:,:)
if (csubset == 0) return
allocate(fock_diag_tmp(2,mo_num+1)) allocate(fock_diag_tmp(2,mo_num+1))
call build_fock_tmp(fock_diag_tmp,psi_det_generators(1,1,i_generator),N_int) call build_fock_tmp(fock_diag_tmp,psi_det_generators(1,1,i_generator),N_int)
@ -177,6 +179,7 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d
monoAdo = .true. monoAdo = .true.
monoBdo = .true. monoBdo = .true.
if (csubset == 0) return
do k=1,N_int do k=1,N_int
hole (k,1) = iand(psi_det_generators(k,1,i_generator), hole_mask(k,1)) hole (k,1) = iand(psi_det_generators(k,1,i_generator), hole_mask(k,1))

View File

@ -6,6 +6,7 @@ BEGIN_PROVIDER [ double precision, cholesky_mo, (mo_num, mo_num, cholesky_ao_num
integer :: k integer :: k
call set_multiple_levels_omp(.False.)
!$OMP PARALLEL DO PRIVATE(k) !$OMP PARALLEL DO PRIVATE(k)
do k=1,cholesky_ao_num do k=1,cholesky_ao_num
call ao_to_mo(cholesky_ao(1,1,k),ao_num,cholesky_mo(1,1,k),mo_num) call ao_to_mo(cholesky_ao(1,1,k),ao_num,cholesky_mo(1,1,k),mo_num)