9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 05:53:37 +01:00

added OPENMP on 1/r12

This commit is contained in:
AbdAmmar 2023-09-02 18:11:05 +02:00
parent 90ff4af1a0
commit 63f6404f8e
2 changed files with 72 additions and 15 deletions

View File

@ -159,25 +159,48 @@ BEGIN_PROVIDER [double precision, ao_two_e_coul, (ao_num, ao_num, ao_num, ao_num
! !
END_DOC END_DOC
integer :: i, j, k, l integer :: i, j, k, l
double precision :: integral double precision :: integral
double precision, external :: get_ao_two_e_integral double precision, allocatable :: tmp(:)
double precision, external :: get_ao_two_e_integral
PROVIDE ao_integrals_map PROVIDE ao_integrals_map
!$OMP PARALLEL DEFAULT(NONE) &
!$OMP SHARED(ao_num, ao_two_e_coul, ao_integrals_map) &
!$OMP PRIVATE(i, j, k, l)
!$OMP DO
do j = 1, ao_num do j = 1, ao_num
do l = 1, ao_num do l = 1, ao_num
do i = 1, ao_num do i = 1, ao_num
do k = 1, ao_num do k = 1, ao_num
! < 1:k, 2:l | 1:i, 2:j > ! < 1:k, 2:l | 1:i, 2:j >
integral = get_ao_two_e_integral(i, j, k, l, ao_integrals_map) ao_two_e_coul(k,i,l,j) = get_ao_two_e_integral(i, j, k, l, ao_integrals_map)
ao_two_e_coul(k,i,l,j) = integral
enddo enddo
enddo enddo
enddo enddo
enddo enddo
!$OMP END DO
!$OMP END PARALLEL
! TODO
! allocate(tmp(ao_num))
!
! !$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(i,l,j,k,tmp)
! do j = 1, ao_num
! do l = 1, ao_num
! do i = 1, ao_num
! call get_ao_two_e_integrals(i, l, l, ao_num, tmp(1))
! do k = 1, ao_num
! ao_two_e_coul(k,i,l,j) = tmp(k)
! enddo
! enddo
! enddo
! enddo
! !$OMP END PARALLEL DO
!
! deallocate(tmp)
END_PROVIDER END_PROVIDER

View File

@ -1,12 +1,11 @@
! --- ! ---
BEGIN_PROVIDER [double precision, fock_3e_uhf_mo_a, (mo_num, mo_num)] BEGIN_PROVIDER [double precision, fock_3e_uhf_mo_a, (mo_num, mo_num)]
&BEGIN_PROVIDER [double precision, fock_3e_uhf_mo_b, (mo_num, mo_num)]
BEGIN_DOC BEGIN_DOC
! !
! Fock matrix from three-electron terms ! Fock matrix alpha from three-electron terms
! !
! WARNING :: non hermitian if bi-ortho MOS used ! WARNING :: non hermitian if bi-ortho MOS used
! !
@ -17,25 +16,60 @@
PROVIDE mo_l_coef mo_r_coef PROVIDE mo_l_coef mo_r_coef
!print *, ' Providing fock_3e_uhf_mo_a and fock_3e_uhf_mo_b ...' !print *, ' Providing fock_3e_uhf_mo_a ...'
!call wall_time(ti) !call wall_time(ti)
! CLOSED-SHELL PART ! CLOSED-SHELL PART
PROVIDE fock_3e_uhf_mo_cs PROVIDE fock_3e_uhf_mo_cs
fock_3e_uhf_mo_a = fock_3e_uhf_mo_cs fock_3e_uhf_mo_a = fock_3e_uhf_mo_cs
fock_3e_uhf_mo_b = fock_3e_uhf_mo_cs
if(elec_alpha_num .ne. elec_beta_num) then if(elec_alpha_num .ne. elec_beta_num) then
! OPEN-SHELL PART ! OPEN-SHELL PART
PROVIDE fock_3e_uhf_mo_a_os fock_3e_uhf_mo_b_os PROVIDE fock_3e_uhf_mo_a_os
fock_3e_uhf_mo_a += fock_3e_uhf_mo_a_os fock_3e_uhf_mo_a += fock_3e_uhf_mo_a_os
fock_3e_uhf_mo_b += fock_3e_uhf_mo_b_os
endif endif
!call wall_time(tf) !call wall_time(tf)
!print *, ' Wall time for fock_3e_uhf_mo_a and fock_3e_uhf_mo_b =', tf - ti !print *, ' Wall time for fock_3e_uhf_mo_a =', tf - ti
END_PROVIDER
! ---
BEGIN_PROVIDER [double precision, fock_3e_uhf_mo_b, (mo_num, mo_num)]
BEGIN_DOC
!
! Fock matrix beta from three-electron terms
!
! WARNING :: non hermitian if bi-ortho MOS used
!
END_DOC
implicit none
double precision :: ti, tf
PROVIDE mo_l_coef mo_r_coef
!print *, ' Providing and fock_3e_uhf_mo_b ...'
!call wall_time(ti)
! CLOSED-SHELL PART
PROVIDE fock_3e_uhf_mo_cs
fock_3e_uhf_mo_b = fock_3e_uhf_mo_cs
if(elec_alpha_num .ne. elec_beta_num) then
! OPEN-SHELL PART
PROVIDE fock_3e_uhf_mo_b_os
fock_3e_uhf_mo_b += fock_3e_uhf_mo_b_os
endif
!call wall_time(tf)
!print *, ' Wall time for fock_3e_uhf_mo_b =', tf - ti
END_PROVIDER END_PROVIDER