4
1
mirror of https://github.com/pfloos/quack synced 2024-12-23 04:43:53 +01:00

fixing openmp bugs and some warning

This commit is contained in:
Antoine Marie 2023-08-21 10:54:33 +02:00
parent 9e65d4a090
commit ddb24ecf99
10 changed files with 125 additions and 134 deletions

View File

@ -97,7 +97,6 @@ subroutine GF2_phBSE2_dynamic_kernel_A(ispin,eta,nBas,nC,nO,nV,nR,nS,lambda,ERI,
end do
end do
!$omp end parallel do
end if
@ -106,7 +105,7 @@ subroutine GF2_phBSE2_dynamic_kernel_A(ispin,eta,nBas,nC,nO,nV,nR,nS,lambda,ERI,
if(ispin == 2) then
jb = 0
!$omp parallel do default(private) shared(A_dyn,ZA_dyn,ERI,OmBSE,num,dem,eGF,nO,nBas,eta,nC,nR)
!$omp parallel do default(private) shared(KA_dyn,ZA_dyn,ERI,OmBSE,num,dem,eGF,nO,nBas,eta,nC,nR)
do j=nC+1,nO
do b=nO+1,nBas-nR
jb = (b-nO) + (j-1)*(nBas-nO)

View File

@ -100,7 +100,7 @@ subroutine GF2_phBSE2_dynamic_kernel_B(ispin,eta,nBas,nC,nO,nV,nR,nS,lambda,ERI,
if(ispin == 2) then
jb = 0
!$omp parallel do default(private) shared(B_dyn,ERI,num,dem,eGF,nO,nBas,eta,nC,nR)
!$omp parallel do default(private) shared(KB_dyn,ERI,num,dem,eGF,nO,nBas,eta,nC,nR)
do j=nC+1,nO
do b=nO+1,nBas-nR
jb = (b-nO) + (j-1)*(nBas-nO)

View File

@ -44,7 +44,7 @@ subroutine GTeh_self_energy(eta,nBas,nC,nO,nV,nR,nS,e,Om,rhoL,rhoR,EcGM,Sig,Z)
! Occupied part of the correlation self-energy
!$OMP PARALLEL &
!$OMP SHARED(Sig,rho,eta,nS,nC,nO,nBas,nR,e,Om) &
!$OMP SHARED(Sig,Z,rhoL,rhoR,eta,nS,nC,nO,nBas,nR,e,Om) &
!$OMP PRIVATE(m,i,q,p,num,eps) &
!$OMP DEFAULT(NONE)
!$OMP DO
@ -65,10 +65,10 @@ subroutine GTeh_self_energy(eta,nBas,nC,nO,nV,nR,nS,e,Om,rhoL,rhoR,EcGM,Sig,Z)
!$OMP END DO
!$OMP END PARALLEL
! Virtual part of the correlation self-energy
! Virtual part of the correlation self-energy
!$OMP PARALLEL &
!$OMP SHARED(Sig,rho,eta,nS,nC,nO,nBas,nR,e,Om) &
!$OMP SHARED(Sig,Z,rhoL,rhoR,eta,nS,nC,nO,nBas,nR,e,Om) &
!$OMP PRIVATE(m,a,q,p,num,eps) &
!$OMP DEFAULT(NONE)
!$OMP DO

View File

@ -44,65 +44,63 @@ subroutine GTpp_excitation_density(ispin,nBas,nC,nO,nV,nR,nOO,nVV,ERI,X1,Y1,rho1
if(ispin == 1) then
!$OMP PARALLEL &
!$OMP SHARED(nC,nBas,nR,nO,nVV,nOO,rho1,rho2,ERI,X1,Y1,X2,Y2) &
!$OMP PRIVATE(q,p,ab,cd,kl,ij) &
!$OMP DEFAULT(NONE)
!$OMP DO
!$OMP PARALLEL &
!$OMP SHARED(nC,nBas,nR,nO,nVV,nOO,rho1,rho2,ERI,X1,Y1,X2,Y2) &
!$OMP PRIVATE(q,p,ab,cd,kl,ij) &
!$OMP DEFAULT(NONE)
!$OMP DO
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
do ab=1,nVV
do ab=1,nVV
cd = 0
do c=nO+1,nBas-nR
do d=c,nBas-nR
cd = cd + 1
rho1(p,q,ab) = rho1(p,q,ab) &
+ ERI(p,q,c,d)*X1(cd,ab)/sqrt((1d0 + Kronecker_delta(c,d)))
end do
end do
cd = 0
do c=nO+1,nBas-nR
do d=c,nBas-nR
cd = cd + 1
rho1(p,q,ab) = rho1(p,q,ab) &
+ ERI(p,q,c,d)*X1(cd,ab)/sqrt((1d0 + Kronecker_delta(c,d)))
end do
end do
kl = 0
do k=nC+1,nO
do l=k,nO
kl = kl + 1
rho1(p,q,ab) = rho1(p,q,ab) &
+ ERI(p,q,k,l)*Y1(kl,ab)/sqrt((1d0 + Kronecker_delta(k,l)))
end do
end do
kl = 0
do k=nC+1,nO
do l=k,nO
kl = kl + 1
rho1(p,q,ab) = rho1(p,q,ab) &
+ ERI(p,q,k,l)*Y1(kl,ab)/sqrt((1d0 + Kronecker_delta(k,l)))
end do
end do
end do
do ij=1,nOO
cd = 0
do c=nO+1,nBas-nR
do d=c,nBas-nR
cd = cd + 1
rho2(p,q,ij) = rho2(p,q,ij) &
+ ERI(p,q,c,d)*X2(cd,ij)/sqrt((1d0 + Kronecker_delta(c,d)))
end do
end do
kl = 0
do k=nC+1,nO
do l=k,nO
kl = kl + 1
rho2(p,q,ij) = rho2(p,q,ij) &
+ ERI(p,q,k,l)*Y2(kl,ij)/sqrt((1d0 + Kronecker_delta(k,l)))
end do
end do
end do
end do
!$OMP END DO
!$OMP DO
do ij=1,nOO
cd = 0
do c=nO+1,nBas-nR
do d=c,nBas-nR
cd = cd + 1
rho2(p,q,ij) = rho2(p,q,ij) &
+ ERI(p,q,c,d)*X2(cd,ij)/sqrt((1d0 + Kronecker_delta(c,d)))
end do
end do
kl = 0
do k=nC+1,nO
do l=k,nO
kl = kl + 1
rho2(p,q,ij) = rho2(p,q,ij) &
+ ERI(p,q,k,l)*Y2(kl,ij)/sqrt((1d0 + Kronecker_delta(k,l)))
end do
end do
end do
end do
end do
!$OMP END DO
!$OMP END PARALLEL
end do
!$OMP END DO
!$OMP END PARALLEL
end if
!----------------------------------------------
@ -179,72 +177,69 @@ subroutine GTpp_excitation_density(ispin,nBas,nC,nO,nV,nR,nOO,nVV,ERI,X1,Y1,rho1
if(ispin == 3) then
!$OMP PARALLEL &
!$OMP SHARED(nC,nBas,nR,nO,nVV,nOO,rho1,rho2,ERI,X1,Y1,X2,Y2) &
!$OMP PRIVATE(q,p,ab,cd,kl,ij,c,d,k,l) &
!$OMP DEFAULT(NONE)
!$OMP DO
!$OMP PARALLEL &
!$OMP SHARED(nC,nBas,nR,nO,nVV,nOO,rho1,rho2,ERI,X1,Y1,X2,Y2) &
!$OMP PRIVATE(q,p,ab,cd,kl,ij,c,d,k,l) &
!$OMP DEFAULT(NONE)
!$OMP DO
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
do p=nC+1,nBas-nR
! do ab=1,nVV
ab = 0
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
ab = ab + 1
! do ab=1,nVV
ab = 0
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
ab = ab + 1
cd = 0
do c=nO+1,nBas-nR
do d=nO+1,nBas-nR
cd = cd + 1
rho1(p,q,ab) = rho1(p,q,ab) + ERI(p,q,c,d)*X1(cd,ab)
end do
end do
cd = 0
do c=nO+1,nBas-nR
do d=nO+1,nBas-nR
cd = cd + 1
rho1(p,q,ab) = rho1(p,q,ab) + ERI(p,q,c,d)*X1(cd,ab)
end do
end do
kl = 0
do k=nC+1,nO
do l=nC+1,nO
kl = kl + 1
rho1(p,q,ab) = rho1(p,q,ab) + ERI(p,q,k,l)*Y1(kl,ab)
end do
end do
kl = 0
do k=nC+1,nO
do l=nC+1,nO
kl = kl + 1
rho1(p,q,ab) = rho1(p,q,ab) + ERI(p,q,k,l)*Y1(kl,ab)
end do
end do
end do
end do
! do ij=1,nOO
ij = 0
do i=nC+1,nO
do j=nC+1,nO
ij = ij + 1
cd = 0
do c=nO+1,nBas-nR
do d=nO+1,nBas-nR
cd = cd + 1
rho2(p,q,ij) = rho2(p,q,ij) + ERI(p,q,c,d)*X2(cd,ij)
end do
end do
kl = 0
do k=nC+1,nO
do l=nC+1,nO
kl = kl + 1
rho2(p,q,ij) = rho2(p,q,ij) + ERI(p,q,k,l)*Y2(kl,ij)
end do
end do
end do
end do
end do
end do
!$OMP END DO
!$OMP DO
! do ij=1,nOO
ij = 0
do i=nC+1,nO
do j=nC+1,nO
ij = ij + 1
cd = 0
do c=nO+1,nBas-nR
do d=nO+1,nBas-nR
cd = cd + 1
rho2(p,q,ij) = rho2(p,q,ij) + ERI(p,q,c,d)*X2(cd,ij)
end do
end do
kl = 0
do k=nC+1,nO
do l=nC+1,nO
kl = kl + 1
rho2(p,q,ij) = rho2(p,q,ij) + ERI(p,q,k,l)*Y2(kl,ij)
end do
end do
end do
end do
end do
end do
!$OMP END DO
!$OMP END PARALLEL
end do
!$OMP END DO
!$OMP END PARALLEL
end if

View File

@ -24,6 +24,7 @@ subroutine print_qsGTeh(nBas,nO,nSCF,Conv,thresh,eHF,eGT,c,SigC,Z,ENuc,ET,EV,EJ,
double precision,intent(in) :: c(nBas)
double precision,intent(in) :: SigC(nBas,nBas)
double precision,intent(in) :: Z(nBas)
double precision,intent(in) :: EqsGT
double precision,intent(in) :: dipole(ncart)
! Local variables
@ -34,8 +35,6 @@ subroutine print_qsGTeh(nBas,nO,nSCF,Conv,thresh,eHF,eGT,c,SigC,Z,ENuc,ET,EV,EJ,
! Output variables
double precision,intent(out) :: EqsGT
! HOMO and LUMO
HOMO = nO

View File

@ -24,6 +24,7 @@ subroutine print_qsGTpp(nBas,nO,nSCF,Conv,thresh,eHF,eGT,c,SigC,Z,ENuc,ET,EV,EJ,
double precision,intent(in) :: c(nBas)
double precision,intent(in) :: SigC(nBas,nBas)
double precision,intent(in) :: Z(nBas)
double precision,intent(in) :: EqsGT
double precision,intent(in) :: dipole(ncart)
! Local variables
@ -34,8 +35,6 @@ subroutine print_qsGTpp(nBas,nO,nSCF,Conv,thresh,eHF,eGT,c,SigC,Z,ENuc,ET,EV,EJ,
! Output variables
double precision,intent(out) :: EqsGT
! HOMO and LUMO
HOMO = nO

View File

@ -42,7 +42,7 @@ subroutine GW_self_energy(eta,nBas,nC,nO,nV,nR,nS,e,Om,rho,EcGM,Sig,Z)
! Occupied part of the correlation self-energy
!$OMP PARALLEL &
!$OMP SHARED(Sig,rho,eta,nS,nC,nO,nBas,nR,e,Om) &
!$OMP SHARED(Sig,Z,rho,eta,nS,nC,nO,nBas,nR,e,Om) &
!$OMP PRIVATE(m,i,q,p,eps,num) &
!$OMP DEFAULT(NONE)
!$OMP DO
@ -66,7 +66,7 @@ subroutine GW_self_energy(eta,nBas,nC,nO,nV,nR,nS,e,Om,rho,EcGM,Sig,Z)
! Virtual part of the correlation self-energy
!$OMP PARALLEL &
!$OMP SHARED(Sig,rho,eta,nS,nC,nO,nBas,nR,e,Om) &
!$OMP SHARED(Sig,Z,rho,eta,nS,nC,nO,nBas,nR,e,Om) &
!$OMP PRIVATE(m,a,q,p,eps,num) &
!$OMP DEFAULT(NONE)
!$OMP DO

View File

@ -24,6 +24,7 @@ subroutine print_qsGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,c,SigC,Z,ENuc,ET,EV,EJ,Ex
double precision,intent(in) :: c(nBas)
double precision,intent(in) :: SigC(nBas,nBas)
double precision,intent(in) :: Z(nBas)
double precision,intent(in) :: EqsGW
double precision,intent(in) :: dipole(ncart)
! Local variables
@ -34,8 +35,6 @@ subroutine print_qsGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,c,SigC,Z,ENuc,ET,EV,EJ,Ex
! Output variables
double precision,intent(out) :: EqsGW
! HOMO and LUMO
HOMO = nO

View File

@ -78,8 +78,8 @@ FIX_ORDER_OF_LIBS=-Wl,--start-group
if sys.platform in ["linux", "linux2"]:
compiler = compile_gfortran_linux
# compiler = compile_ifort_linux
# compiler = compile_gfortran_linux
compiler = compile_ifort_linux
elif sys.platform == "darwin":
compiler = compile_gfortran_mac
else:

View File

@ -7,7 +7,7 @@ subroutine read_basis_pyscf(nBas,nO,nV)
! Input variables
integer,intent(out) :: nO(nspin)
integer,intent(in) :: nO(nspin)
! Local variables