10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-02 03:15:29 +02:00

Improved KSRS, but tests fail

This commit is contained in:
Anthony Scemama 2019-01-07 01:19:01 +01:00
parent 3c5951c8e1
commit 7258f78305
4 changed files with 18 additions and 29 deletions

View File

@ -34,7 +34,7 @@
ao_two_e_integral_beta_tmp = 0.d0
q = ao_num*ao_num*ao_num*ao_num
!$OMP DO SCHEDULE(static,1)
!$OMP DO SCHEDULE(static,64)
do p=1_8,q
call two_e_integrals_index_reverse(kk,ii,ll,jj,p)
if ( (kk(1)>ao_num).or. &
@ -90,8 +90,6 @@
!$OMP END DO NOWAIT
!$OMP CRITICAL
ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp
!$OMP END CRITICAL
!$OMP CRITICAL
ao_two_e_integral_beta += ao_two_e_integral_beta_tmp
!$OMP END CRITICAL
deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)
@ -143,13 +141,9 @@
enddo
enddo
enddo
!$OMP END DO
!$OMP BARRIER
!$OMP END DO NOWAIT
!$OMP CRITICAL
ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp
!$OMP END CRITICAL
!$OMP BARRIER
!$OMP CRITICAL
ao_two_e_integral_beta += ao_two_e_integral_beta_tmp
!$OMP END CRITICAL
deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)

View File

@ -7,26 +7,27 @@ function run() {
thresh=1.e-8
qp_edit -c $1
ezfio set_file $1
rm -rf $1/mo_basis
ezfio set scf_utils thresh_scf 1.e-10
echo "short_range_PBE" > $1/dft_keywords/exchange_functional
echo "short_range_PBE" > $1/dft_keywords/correlation_functional
echo "0.5" > $1/ao_two_e_erf_ints/mu_erf
echo "1" > $1/becke_numerical_grid/grid_type_sgn
ezfio set dft_keywords exchange_functional "short_range_PBE"
ezfio set dft_keywords correlation_functional "short_range_PBE"
ezfio set ao_two_e_erf_ints mu_erf 0.5
ezfio set becke_numerical_grid grid_type_sgn 1
qp_run rs_ks_scf $1
energy="$(ezfio get kohn_sham_rs energy)"
eq $energy $2 $thresh
}
@test "HCN" {
run hcn.ezfio -93.26674673761752
}
@test "H3COH" {
run h3coh.ezfio -115.50238225208
}
@test "HCN" {
run hcn.ezfio -93.26674673761752
}
@test "N2" {
run n2.ezfio -109.404692225719
}

View File

@ -35,7 +35,7 @@
ao_two_e_integral_beta_tmp = 0.d0
q = ao_num*ao_num*ao_num*ao_num
!$OMP DO SCHEDULE(dynamic)
!$OMP DO SCHEDULE(static,64)
do p=1_8,q
call two_e_integrals_index_reverse(kk,ii,ll,jj,p)
if ( (kk(1)>ao_num).or. &
@ -91,8 +91,6 @@
!$OMP END DO NOWAIT
!$OMP CRITICAL
ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp
!$OMP END CRITICAL
!$OMP CRITICAL
ao_two_e_integral_beta += ao_two_e_integral_beta_tmp
!$OMP END CRITICAL
deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)
@ -111,7 +109,7 @@
integer(key_kind), allocatable :: keys_erf(:)
double precision, allocatable :: values_erf(:)
!$OMP PARALLEL DEFAULT(NONE) &
!$OMP PARALLEL DEFAULT(NONE) if (ao_num > 100) &
!$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,n_elements_max, &
!$OMP n_elements,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)&
!$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,&
@ -124,7 +122,7 @@
ao_two_e_integral_alpha_tmp = 0.d0
ao_two_e_integral_beta_tmp = 0.d0
!$OMP DO SCHEDULE(dynamic,64)
!$OMP DO SCHEDULE(static,1)
!DIR$ NOVECTOR
do i8=0_8,ao_integrals_map%map_size
n_elements = n_elements_max
@ -147,16 +145,14 @@
enddo
enddo
!$OMP END DO NOWAIT
!$OMP CRITICAL
!$OMP CRITICAL
ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp
!$OMP END CRITICAL
!$OMP CRITICAL
ao_two_e_integral_beta += ao_two_e_integral_beta_tmp
!$OMP END CRITICAL
deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)
!$OMP END PARALLEL
!$OMP PARALLEL DEFAULT(NONE) &
!$OMP PARALLEL DEFAULT(NONE) if (ao_num > 100) &
!$OMP PRIVATE(i,j,l,k1,k,integral_erf,ii,jj,kk,ll,i8,keys_erf,values_erf,n_elements_max_erf, &
!$OMP n_elements_erf,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)&
!$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,&
@ -170,7 +166,7 @@
ao_two_e_integral_alpha_tmp = 0.d0
ao_two_e_integral_beta_tmp = 0.d0
!$OMP DO SCHEDULE(dynamic,64)
!$OMP DO SCHEDULE(static,1)
!DIR$ NOVECTOR
do i8=0_8,ao_integrals_erf_map%map_size
n_elements_erf = n_elements_max_erf
@ -197,8 +193,6 @@
!$OMP END DO NOWAIT
!$OMP CRITICAL
ao_two_e_integral_alpha = ao_two_e_integral_alpha + ao_two_e_integral_alpha_tmp
!$OMP END CRITICAL
!$OMP CRITICAL
ao_two_e_integral_beta = ao_two_e_integral_beta + ao_two_e_integral_beta_tmp
!$OMP END CRITICAL
deallocate(ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)

View File

@ -289,7 +289,7 @@ END_DOC
! Compute extrapolated Fock matrix
!$OMP PARALLEL DO PRIVATE(i,j,k) DEFAULT(SHARED)
!$OMP PARALLEL DO PRIVATE(i,j,k) DEFAULT(SHARED) if (ao_num > 200)
do j=1,ao_num
do i=1,ao_num
Fock_matrix_AO_(i,j) = 0.d0