Skip to content

Commit

Permalink
Merge pull request #346 from QuantumPackage/dev-stable
Browse files Browse the repository at this point in the history
Dev stable
  • Loading branch information
scemama authored Sep 9, 2024
2 parents 38aa8ef + 9a284e7 commit 151b1c5
Show file tree
Hide file tree
Showing 323 changed files with 17,815 additions and 13,583 deletions.
23 changes: 0 additions & 23 deletions bin/zcat

This file was deleted.

63 changes: 63 additions & 0 deletions config/gfortran_debug_mkl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Common flags
##############
#
# -ffree-line-length-none : Needed for IRPF90 which produces long lines
# -lblas -llapack : Link with libblas and liblapack libraries provided by the system
# -I . : Include the curent directory (Mandatory)
#
# --ninja : Allow the utilisation of ninja. (Mandatory)
# --align=32 : Align all provided arrays on a 32-byte boundary
#
#
[COMMON]
FC : gfortran -g -ffree-line-length-none -I . -fPIC -std=legacy
LAPACK_LIB : -I${MKLROOT}/include -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_core -lpthread -lm -ldl -lmkl_gnu_thread -lgomp -fopenmp
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED

# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
[OPTION]
MODE : DEBUG ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 0 ; Enable cache_compile.py
OPENMP : 1 ; Append OpenMP flags

# Optimization flags
####################
#
# -Ofast : Disregard strict standards compliance. Enables all -O3 optimizations.
# It also enables optimizations that are not valid
# for all standard-compliant programs. It turns on
# -ffast-math and the Fortran-specific
# -fno-protect-parens and -fstack-arrays.
[OPT]
FCFLAGS : -Ofast

# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -Ofast

# Debugging flags
#################
#
# -fcheck=all : Checks uninitialized variables, array subscripts, etc...
# -g : Extra debugging information
#
[DEBUG]
#FCFLAGS : -g -msse4.2 -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized -fbacktrace -ffpe-trap=zero,overflow,underflow -finit-real=nan
FCFLAGS : -g -mavx -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized -fbacktrace -ffpe-trap=zero,overflow -finit-real=nan

# OpenMP flags
#################
#
[OPENMP]
FC : -fopenmp
IRPF90_FLAGS : --openmp

40 changes: 33 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ Usage:
$(basename $0) -c <file>
$(basename $0) -h
$(basename $0) -i <package>
$(basename $0) -g [nvidia|intel|none]
Options:
-c <file> Define a COMPILATION configuration file,
in "${QP_ROOT}/config/".
-h Print the HELP message
-i <package> INSTALL <package>. Use at your OWN RISK:
no support will be provided for the installation of
dependencies.
-c <file> Define a COMPILATION configuration file,
in "${QP_ROOT}/config/".
-h Print the HELP message
-i <package> INSTALL <package>. Use at your OWN RISK:
no support will be provided for the installation of
dependencies.
-g [nvidia|intel|none] Choose GPU acceleration
Example:
./$(basename $0) -c config/gfortran.cfg
Expand Down Expand Up @@ -83,7 +85,7 @@ function execute () {
PACKAGES=""


while getopts "d:c:i:h" c ; do
while getopts "d:c:i:g:h" c ; do
case "$c" in
c)
case "$OPTARG" in
Expand All @@ -100,6 +102,9 @@ while getopts "d:c:i:h" c ; do
"") help ; break;;
*) PACKAGES="${PACKAGE} $OPTARG"
esac;;
g)
GPU=$OPTARG;
break;;
h)
help
exit 0;;
Expand All @@ -109,6 +114,27 @@ while getopts "d:c:i:h" c ; do
esac
done

# Handle GPU acceleration
rm -f ${QP_ROOT}/src/gpu_arch
case "$GPU" in
amd) # AMD
echo "Activating AMD GPU acceleration"
ln -s ${QP_ROOT}/plugins/local/gpu_amd ${QP_ROOT}/src/gpu_arch
;;
intel) # Intel
echo "Activating Intel GPU acceleration (EXPERIMENTAL)"
ln -s ${QP_ROOT}/plugins/local/gpu_intel ${QP_ROOT}/src/gpu_arch
;;
nvidia) # Nvidia
echo "Activating Nvidia GPU acceleration"
ln -s ${QP_ROOT}/plugins/local/gpu_nvidia ${QP_ROOT}/src/gpu_arch
;;
*) # No Acceleration
echo "Disabling GPU acceleration"
ln -s ${QP_ROOT}/plugins/local/gpu_x86 ${QP_ROOT}/src/gpu_arch
;;
esac

# Trim leading and trailing spaces
PACKAGES=$(echo $PACKAGES | xargs)

Expand Down
9 changes: 9 additions & 0 deletions etc/paths.rc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ function qp_prepend_export () {
fi
}

function qp_append_export () {
eval "value_1="\${$1}""
if [[ -z $value_1 ]] ; then
echo "${2}:"
else
echo "${value_1}:${2}"
fi
}

export PYTHONPATH=$(qp_prepend_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PYTHON}")

export PATH=$(qp_prepend_export "PATH" "${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml)
Expand Down
2 changes: 1 addition & 1 deletion external/irpf90
Submodule irpf90 updated from beac61 to 4ab1b1
8 changes: 0 additions & 8 deletions plugins/local/basis_correction/51.basis_c.bats
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ function run_sd() {
eq $energy1 $1 $thresh
}

@test "O2 CAS" {
qp set_file o2_cas.gms.ezfio
qp set_mo_class -c "[1-2]" -a "[3-10]" -d "[11-46]"
run -149.72435425 3.e-4 10000
qp set_mo_class -c "[1-2]" -a "[3-10]" -v "[11-46]"
run_md -0.1160222327 1.e-6
}


@test "LiF RHF" {
qp set_file lif.ezfio
Expand Down
4 changes: 0 additions & 4 deletions plugins/local/basis_correction/basis_correction.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ program basis_correction
touch read_wf
no_core_density = .True.
touch no_core_density
if(io_mo_two_e_integrals .ne. "Read")then
provide ao_two_e_integrals_in_map
endif
provide mo_two_e_integrals_in_map
call print_basis_correction
end

2 changes: 1 addition & 1 deletion plugins/local/basis_correction/print_routine.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ subroutine print_basis_correction
print*, '****************************************'
print*, '****************************************'
print*, 'mu_of_r_potential = ',mu_of_r_potential
if(mu_of_r_potential.EQ."hf")then
if(mu_of_r_potential.EQ."hf".or.mu_of_r_potential.EQ."hf_old".or.mu_of_r_potential.EQ."hf_sparse")then
print*, ''
print*,'Using a HF-like two-body density to define mu(r)'
print*,'This assumes that HF is a qualitative representation of the wave function '
Expand Down
18 changes: 18 additions & 0 deletions plugins/local/basis_correction/test_chol_bas.irp.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
program pouet
implicit none
call test
end
subroutine test
implicit none
! provide mos_times_cholesky_r1
! provide mos_times_cholesky_r2
integer :: ipoint
double precision :: accu,weight
accu = 0.d0
do ipoint = 1, n_points_final_grid
weight = final_weight_at_r_vector(ipoint)
! accu += dabs(mu_of_r_hf(ipoint) - mu_of_r_hf_old(ipoint)) * weight
accu += dabs(f_hf_cholesky_sparse(ipoint) - f_hf_cholesky(ipoint)) * weight
enddo
print*,'accu = ',accu
end
95 changes: 94 additions & 1 deletion plugins/local/bi_ort_ints/bi_ort_ints.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ program bi_ort_ints
! call test_3e
! call test_5idx
! call test_5idx2
call test_4idx()
! call test_4idx()
!call test_4idx_n4()
!call test_4idx2()
!call test_5idx2
!call test_5idx

call test_mos_in_r()
call test_int2_grad1_u12_bimo_t()

end

subroutine test_5idx2
Expand Down Expand Up @@ -472,4 +475,94 @@ subroutine test_4idx()
return
end

! ---

subroutine test_mos_in_r()

implicit none

integer :: i, j
double precision :: err_tot, nrm_tot, err_loc, acc_thr

PROVIDE mos_l_in_r_array_transp_old mos_r_in_r_array_transp_old
PROVIDE mos_l_in_r_array_transp mos_r_in_r_array_transp

acc_thr = 1d-13

err_tot = 0.d0
nrm_tot = 0.d0
do i = 1, mo_num
do j = 1, n_points_final_grid
err_loc = dabs(mos_l_in_r_array_transp_old(j,i) - mos_l_in_r_array_transp(j,i))
if(err_loc > acc_thr) then
print*, " error on", j, i
print*, " old res", mos_l_in_r_array_transp_old(j,i)
print*, " new res", mos_l_in_r_array_transp (j,i)
stop
endif
err_tot = err_tot + err_loc
nrm_tot = nrm_tot + dabs(mos_l_in_r_array_transp_old(j,i))
enddo
enddo
print *, ' absolute accuracy on mos_l_in_r_array_transp (%) =', 100.d0 * err_tot / nrm_tot

err_tot = 0.d0
nrm_tot = 0.d0
do i = 1, mo_num
do j = 1, n_points_final_grid
err_loc = dabs(mos_r_in_r_array_transp_old(j,i) - mos_r_in_r_array_transp(j,i))
if(err_loc > acc_thr) then
print*, " error on", j, i
print*, " old res", mos_r_in_r_array_transp_old(j,i)
print*, " new res", mos_r_in_r_array_transp (j,i)
stop
endif
err_tot = err_tot + err_loc
nrm_tot = nrm_tot + dabs(mos_r_in_r_array_transp_old(j,i))
enddo
enddo
print *, ' absolute accuracy on mos_r_in_r_array_transp (%) =', 100.d0 * err_tot / nrm_tot

return
end

! ---

subroutine test_int2_grad1_u12_bimo_t()

implicit none
integer :: i, j, ipoint, m
double precision :: err_tot, nrm_tot, err_loc, acc_thr

PROVIDE int2_grad1_u12_bimo_t_old
PROVIDE int2_grad1_u12_bimo_t

acc_thr = 1d-13

err_tot = 0.d0
nrm_tot = 0.d0
do i = 1, mo_num
do j = 1, mo_num
do m = 1, 3
do ipoint = 1, n_points_final_grid
err_loc = dabs(int2_grad1_u12_bimo_t_old(ipoint,m,j,i) - int2_grad1_u12_bimo_t(ipoint,m,j,i))
if(err_loc > acc_thr) then
print*, " error on", ipoint, m, j, i
print*, " old res", int2_grad1_u12_bimo_t_old(ipoint,m,j,i)
print*, " new res", int2_grad1_u12_bimo_t (ipoint,m,j,i)
stop
endif
err_tot = err_tot + err_loc
nrm_tot = nrm_tot + dabs(int2_grad1_u12_bimo_t_old(ipoint,m,j,i))
enddo
enddo
enddo
enddo
print *, ' absolute accuracy on int2_grad1_u12_bimo_t (%) =', 100.d0 * err_tot / nrm_tot

return
end

! ---


15 changes: 7 additions & 8 deletions plugins/local/bi_ort_ints/no_dressing.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@

BEGIN_PROVIDER [double precision, noL_0e]

BEGIN_DOC
!
! < Phi_left | L | Phi_right >
!
END_DOC

implicit none
integer :: i, j, k, ipoint
double precision :: t0, t1
Expand All @@ -330,10 +336,6 @@
double precision, allocatable :: tmp_M(:,:), tmp_S(:), tmp_O(:), tmp_J(:,:)
double precision, allocatable :: tmp_M_priv(:,:), tmp_S_priv(:), tmp_O_priv(:), tmp_J_priv(:,:)


call wall_time(t0)
print*, " Providing noL_0e ..."

if(elec_alpha_num .eq. elec_beta_num) then

allocate(tmp(elec_beta_num))
Expand Down Expand Up @@ -708,10 +710,7 @@

endif

call wall_time(t1)
print*, " Wall time for noL_0e (min) = ", (t1 - t0)/60.d0

print*, " noL_0e = ", noL_0e
print*, " noL_0e =", noL_0e

END_PROVIDER

Expand Down
Loading

0 comments on commit 151b1c5

Please sign in to comment.