Merge branch 'cleaning_dft' of https://github.com/QuantumPackage/qp2 into cleaning_dft

This commit is contained in:
Emmanuel Giner 2021-07-22 23:29:53 +02:00
commit 2541f1c38f
12 changed files with 100 additions and 245 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "external/irpf90"]
path = external/irpf90
url = https://gitlab.com/scemama/irpf90.git
[submodule "external/qp2-dependencies"]
path = external/qp2-dependencies
url = https://github.com/QuantumPackage/qp2-dependencies.git

View File

@ -20,13 +20,15 @@ Before anything, go into your :file:`quantum_package` directory and run
This script will create the :file:`quantum_package.rc` bash script, which
sets all the environment variables required for the normal operation of the
*Quantum Package*.
*Quantum Package*. It will also initialize the git submodules that are
required, and tell you which external dependencies are missing and need to be
installed. The required dependencies are located in the
`external/qp2-dependencies` directory, such that once QP is configured the
internet connection is not needed any more.
Running this script will also tell you which external dependencies are missing
and need to be installed.
When all dependencies have been installed, ( the :command:`configure` will tell you)
source the :file:`quantum_package.rc` in order to load all environment variables and compile the |QP|.
When all dependencies have been installed, (the :command:`configure` will
inform you) source the :file:`quantum_package.rc` in order to load all
environment variables and compile the |QP|.
Now all the requirements are met, you can compile the programs using
@ -51,8 +53,6 @@ Requirements
- |ZeroMQ| : networking library
- `GMP <https://gmplib.org/>`_ : Gnu Multiple Precision Arithmetic Library
- |OCaml| compiler with |OPAM| package manager
- `Bubblewrap <https://github.com/projectatomic/bubblewrap>`_ : Sandboxing tool required by Opam
- `libcap <https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git>`_ : POSIX capabilities required by Bubblewrap
- |Ninja| : a parallel build system
- |pkg-config| : a tool which returns information about installed libraries
@ -95,9 +95,7 @@ The following packages are supported by the :command:`configure` installer:
* zeromq
* f77zmq
* gmp
* libcap
* bwrap
* ocaml ( :math:`\approx` 10 minutes)
* ocaml (:math:`\approx` 5 minutes)
* ezfio
* docopt
* resultsFile
@ -111,19 +109,21 @@ Example:
.. note::
When installing the ocaml package, you will be asked the location of where it should be installed.
A safe option is to enter the path proposed by the |QP|:
When installing the ocaml package, you will be asked the location of where
it should be installed. A safe option is to enter the path proposed by the
|QP|:
QP>> Please install it here: /your_quantum_package_directory/bin
QP>> Please install it here: /your_quantum_package_directory/bin
So just enter the proposition of the |QP| and press enter.
So just enter the proposition of the |QP| and press enter.
If the :command:`configure` executable fails to install a specific dependency
-----------------------------------------------------------------------------
If the :command:`configure` executable does not succeed to install a specific dependency,
there are some proposition of how to download and install the minimal dependencies to compile and use the |QP|.
If the :command:`configure` executable does not succeed to install a specific
dependency, there are some proposition of how to download and install the
minimal dependencies to compile and use the |QP|.
Before doing anything below, try to install the packages with your package manager

View File

@ -83,9 +83,7 @@
- Added LIB file to add extra libs in plugin
- Using Intel IPP for sorting when using Intel compiler
- Removed parallelism in sorting
ao_one_e_integral_zero
banned_excitations
- Compute banned_excitations from exchange integrals to accelerate with local MOs

184
configure vendored
View File

@ -3,7 +3,7 @@
# Quantum Package configuration script
#
TEMP=$(getopt -o c:i:h -l config:,install:,help -n $0 -- "$@") || exit 1
TEMP=$(getopt -o d:c:i:h -l download:,config:,install:,help -n $0 -- "$@") || exit 1
eval set -- "$TEMP"
export QP_ROOT="$( cd "$(dirname "$0")" ; pwd -P )"
@ -18,20 +18,6 @@ export CC=gcc
git submodule init
git submodule update
# /!\ When updating version, update also etc files
BATS_URL="https://github.com/bats-core/bats-core/archive/v1.1.0.tar.gz"
BUBBLE_URL="https://github.com/projectatomic/bubblewrap/releases/download/v0.3.3/bubblewrap-0.3.3.tar.xz"
DOCOPT_URL="https://github.com/docopt/docopt/archive/0.6.2.tar.gz"
BSE_URL="https://github.com/MolSSI-BSE/basis_set_exchange/archive/v0.8.11.tar.gz"
F77ZMQ_URL="https://github.com/scemama/f77_zmq/archive/v4.2.5.tar.gz"
LIBCAP_URL="https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/snapshot/libcap-2.25.tar.gz"
NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip"
OCAML_URL="https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh"
RESULTS_URL="https://gitlab.com/scemama/resultsFile/-/archive/v2.0/resultsFile-v2.0.tar.gz"
ZEROMQ_URL="https://github.com/zeromq/libzmq/releases/download/v4.2.5/zeromq-4.2.5.tar.gz"
ZLIB_URL="https://www.zlib.net/zlib-1.2.11.tar.gz"
function help()
{
cat <<EOF
@ -82,7 +68,6 @@ function execute () {
}
PACKAGES=""
OCAML_PACKAGES="ocamlbuild cryptokit zmq sexplib ppx_sexp_conv ppx_deriving getopt"
while true ; do
case "$1" in
@ -134,16 +119,6 @@ function success() {
exit 0
}
function download() {
echo "Downloading $1"
echo ""
printf "\e[0;34m"
wget --no-check-certificate $1 --output-document=$2 || error "Unable to download $1"
printf "\e[m"
echo "Saved dowloaded file as $2"
echo ""
}
function not_found() {
echo 'not_found'
}
@ -176,6 +151,10 @@ function find_dir() {
fi
}
# Make program believe stdin is a tty
function faketty() {
script -qfc "$(printf "%q " "$@")" /dev/null
}
# Install IRPF90 if needed
IRPF90=$(find_exe irpf90)
@ -205,7 +184,7 @@ if [[ "${PACKAGES}.x" != ".x" ]] ; then
fi
if [[ ${PACKAGES} = all ]] ; then
PACKAGES="zlib ninja irpf90 zeromq f77zmq gmp libcap bwrap ocaml docopt resultsFile bats"
PACKAGES="zlib ninja zeromq f77zmq gmp ocaml docopt resultsFile bats"
fi
@ -213,10 +192,9 @@ for PACKAGE in ${PACKAGES} ; do
if [[ ${PACKAGE} = ninja ]] ; then
download ${NINJA_URL} "${QP_ROOT}"/external/ninja.zip
execute << EOF
rm -f "\${QP_ROOT}"/bin/ninja
unzip "\${QP_ROOT}"/external/ninja.zip -d "\${QP_ROOT}"/bin
unzip "\${QP_ROOT}"/external/qp2-dependencies/ninja-linux.zip -d "\${QP_ROOT}"/bin
EOF
@ -224,70 +202,31 @@ EOF
execute << EOF
cd "\${QP_ROOT}"/external
tar --bzip2 --extract --file gmp-6.1.2.tar.bz2
tar --bzip2 --extract --file qp2-dependencies/gmp-6.1.2.tar.bz2
cd gmp-6.1.2
./configure --prefix=$QP_ROOT && make -j 8
make install
make -j 8 install
EOF
elif [[ ${PACKAGE} = libcap ]] ; then
download ${LIBCAP_URL} "${QP_ROOT}"/external/libcap.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file libcap.tar.gz
rm libcap.tar.gz
cd libcap-*/libcap
prefix=$QP_ROOT make BUILD_GPERF=no install
EOF
elif [[ ${PACKAGE} = bwrap ]] ; then
download ${BUBBLE_URL} "${QP_ROOT}"/external/bwrap.tar.xz
execute << EOF
cd "\${QP_ROOT}"/external
tar --xz --extract --file bwrap.tar.xz
rm bwrap.tar.xz
cd bubblewrap*
./configure --prefix=$QP_ROOT && make -j 8
make install-exec-am
EOF
elif [[ ${PACKAGE} = irpf90 ]] ; then
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file irpf90.tar.gz
rm irpf90.tar.gz
mv irpf90-* irpf90
cd irpf90
make
EOF
elif [[ ${PACKAGE} = zeromq ]] ; then
download ${ZEROMQ_URL} "${QP_ROOT}"/external/zeromq.tar.gz
execute << EOF
export CC=gcc
export CXX=g++
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file zeromq.tar.gz
rm zeromq.tar.gz
tar --gunzip --extract --file qp2-dependencies/zeromq-4.2.5.tar.gz
cd zeromq-*
./configure --prefix="\$QP_ROOT" --without-libsodium --enable-libunwind=no
make
make -j 8
make install
EOF
elif [[ ${PACKAGE} = f77zmq ]] ; then
download ${F77ZMQ_URL} "${QP_ROOT}"/external/f77_zmq.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file f77_zmq.tar.gz
rm f77_zmq.tar.gz
tar --gunzip --extract --file qp2-dependencies/f77_zmq-4.2.5.tar.gz
cd f77_zmq-*
export ZMQ_H="\$QP_ROOT"/include/zmq.h
make
@ -299,71 +238,28 @@ EOF
elif [[ ${PACKAGE} = ocaml ]] ; then
download ${OCAML_URL} "${QP_ROOT}"/external/opam_installer.sh
if [[ -n ${TRAVIS} ]] ; then
# Special commands for Travis CI
chmod +x "${QP_ROOT}"/external/opam_installer.sh
rm --force ${QP_ROOT}/bin/opam
if [[ -n ${NO_CACHE} ]] ; then
rm -rf ${HOME}/.opam
fi
export OPAMROOT=${HOME}/.opam
cat << EOF | bash ${QP_ROOT}/external/opam_installer.sh --no-backup
${QP_ROOT}/bin
execute <<EOF
source "${QP_ROOT}"/quantum_package.rc
cd "${QP_ROOT}"/external/
tar --gunzip --extract --file qp2-dependencies/ocaml-bundle_x86.tar.gz
echo "" | faketty ./ocaml-bundle/bootstrap.sh "${QP_ROOT}"
echo n | faketty ./ocaml-bundle/configure.sh "${QP_ROOT}"
echo "" | faketty ./ocaml-bundle/compile.sh "${QP_ROOT}"
EOF
rm ${QP_ROOT}/external/opam_installer.sh
# source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
#
# opam switch create ocaml-base-compiler.4.11.1
opam init --verbose --yes --compiler=4.11.1 --disable-sandboxing
eval $(opam env)
opam install -y ${OCAML_PACKAGES} || exit 1
else
# Conventional commands
execute << EOF
chmod +x "${QP_ROOT}"/external/opam_installer.sh
"${QP_ROOT}"/external/opam_installer.sh --no-backup
EOF
execute << EOF
rm --force ${QP_ROOT}/bin/opam
export OPAMROOT=${OPAMROOT:-${QP_ROOT}/external/opam}
echo ${QP_ROOT}/bin \
| sh ${QP_ROOT}/external/opam_installer.sh
EOF
rm ${QP_ROOT}/external/opam_installer.sh
# source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
# opam switch create ocaml-base-compiler.4.11.1 || exit 1
opam init --verbose --yes --compiler=4.11.1 --disable-sandboxing
eval $(opam env)
execute << EOF
opam install -y \${OCAML_PACKAGES} || exit 1
EOF
fi
elif [[ ${PACKAGE} = bse ]] ; then
download ${BSE_URL} "${QP_ROOT}"/external/bse.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file bse.tar.gz
tar --gunzip --extract --file qp2-dependencies/bse-v0.8.11.tar.gz
pip install -e basis_set_exchange-*
EOF
elif [[ ${PACKAGE} = zlib ]] ; then
download ${ZLIB_URL} "${QP_ROOT}"/external/zlib.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file zlib.tar.gz
rm zlib.tar.gz && \
tar --gunzip --extract --file qp2-dependencies/zlib-1.2.11.tar.gz
cd zlib-*/
./configure --prefix=${QP_ROOT} && \
make && make install
@ -372,33 +268,27 @@ EOF
elif [[ ${PACKAGE} = docopt ]] ; then
download ${DOCOPT_URL} "${QP_ROOT}"/external/docopt.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file docopt.tar.gz
tar --gunzip --extract --file qp2-dependencies/docopt-0.6.2.tar.gz
mv docopt-*/docopt.py "\${QP_ROOT}/external/Python"
rm --recursive --force -- docopt-*/ docopt.tar.gz
EOF
elif [[ ${PACKAGE} = resultsFile ]] ; then
download ${RESULTS_URL} "${QP_ROOT}"/external/resultsFile.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file resultsFile.tar.gz
tar --gunzip --extract --file qp2-dependencies/resultsFile-v2.0.tar.gz
mv resultsFile-*/resultsFile "\${QP_ROOT}/external/Python/"
rm --recursive --force resultsFile-* resultsFile.tar.gz
EOF
elif [[ ${PACKAGE} = bats ]] ; then
download ${BATS_URL} "${QP_ROOT}"/external/bats.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar -zxf bats.tar.gz
tar -zxf qp2-dependencies/bats-v1.1.0.tar.gz
( cd bats-core-1.1.0/ ; ./install.sh \${QP_ROOT})
rm --recursive --force -- bats-core-1.1.0 \ "\${QP_ROOT}"/external/bats.tar.gz
EOF
else
@ -417,12 +307,6 @@ if [[ ${NINJA} = $(not_found) ]] ; then
fail
fi
IRPF90=$(find_exe irpf90)
if [[ ${IRPF90} = $(not_found) ]] ; then
error "IRPF90 (irpf90) is not installed."
fail
fi
ZEROMQ=$(find_lib -lzmq)
if [[ ${ZEROMQ} = $(not_found) ]] ; then
error "ZeroMQ (zeromq) is not installed."
@ -441,24 +325,6 @@ if [[ ${ZLIB} = $(not_found) ]] ; then
fail
fi
LIBCAP=$(find_lib -lcap)
if [[ ${LIBCAP} = $(not_found) ]] ; then
error "Libcap (libcap) is not installed."
fail
fi
BWRAP=$(find_exe bwrap)
if [[ ${BWRAP} = $(not_found) ]] ; then
error "Bubblewrap (bwrap) is not installed."
fail
fi
OPAM=$(find_exe opam)
if [[ ${OPAM} = $(not_found) ]] ; then
error "OPAM (ocaml) package manager is not installed."
fail
fi
OCAML=$(find_exe ocaml)
if [[ ${OCAML} = $(not_found) ]] ; then
error "OCaml (ocaml) compiler is not installed."

View File

@ -4,8 +4,10 @@ if [[ -z $OPAMROOT ]]
then
# Comment these lines if you have a system-wide OCaml installation
export OPAMROOT=${QP_ROOT}/external/opam
export PATH="${QP_ROOT}/external/ocaml-bundle/bootstrap/bin:$PATH"
if [[ -f "${QP_ROOT}/external/ocaml-bundle/bootstrap/bin/opam" ]] ; then
eval $(opam env --root "${QP_ROOT}/external/ocaml-bundle/opam" --set-root)
fi
fi
source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true

View File

@ -1,46 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/

Binary file not shown.

1
external/qp2-dependencies vendored Submodule

@ -0,0 +1 @@
Subproject commit 0e1ca91313e4b6ba3ea042b6378c3ff483781fb1

View File

@ -31,7 +31,7 @@ try:
from docopt import docopt
from qp_path import QP_SRC, QP_ROOT, QP_PLUGINS, QP_EZFIO
except ImportError:
print("source .quantum_package.rc")
print("source quantum_package.rc")
raise

View File

@ -37,26 +37,58 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_local, (ao_num,ao_num)]
integer :: num_A,num_B
double precision :: A_center(3),B_center(3),C_center(3)
integer :: power_A(3),power_B(3)
integer :: i,j,k,l,n_pt_in,m
integer :: i,j,k,l,m
double precision :: Vloc, Vpseudo
double precision :: cpu_1, cpu_2, wall_1, wall_2, wall_0
double precision :: wall_1, wall_2, wall_0
integer :: thread_num
integer :: omp_get_thread_num
double precision :: c
double precision :: Z
PROVIDE ao_coef_normalized_ordered_transp
PROVIDE pseudo_v_k_transp pseudo_n_k_transp pseudo_klocmax pseudo_dz_k_transp
ao_pseudo_integrals_local = 0.d0
print*, 'Providing the nuclear electron pseudo integrals (local)'
call wall_time(wall_1)
call cpu_time(cpu_1)
! Dummy iteration for OpenMP
j=1
i=1
l=1
m=1
num_A = ao_nucl(j)
power_A(1:3)= ao_power(j,1:3)
A_center(1:3) = nucl_coord(num_A,1:3)
num_B = ao_nucl(i)
power_B(1:3)= ao_power(i,1:3)
B_center(1:3) = nucl_coord(num_B,1:3)
alpha = ao_expo_ordered_transp(l,j)
beta = ao_expo_ordered_transp(m,i)
c = 0.d0
do k = 1, nucl_num
Z = nucl_charge(k)
C_center(1:3) = nucl_coord(k,1:3)
c = c + Vloc(pseudo_klocmax, &
pseudo_v_k_transp (1,k), &
pseudo_n_k_transp (1,k), &
pseudo_dz_k_transp(1,k), &
A_center,power_A,alpha,B_center,power_B,beta,C_center)
enddo
ao_pseudo_integrals_local = 0.d0
call wall_time(wall_1)
thread_num = 0
!$OMP PARALLEL &
!$OMP DEFAULT (NONE) &
!$OMP PRIVATE (i,j,k,l,m,alpha,beta,A_center,B_center,C_center,power_A,power_B,&
!$OMP num_A,num_B,Z,c,n_pt_in, &
!$OMP num_A,num_B,Z,c, &
!$OMP wall_0,wall_2,thread_num) &
!$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp,&
!$OMP ao_pseudo_integrals_local,nucl_num,nucl_charge, &
@ -66,7 +98,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_local, (ao_num,ao_num)]
!$ thread_num = omp_get_thread_num()
wall_0 = wall_1
!$OMP DO SCHEDULE (guided)
!$OMP DO
do j = 1, ao_num
@ -85,7 +117,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_local, (ao_num,ao_num)]
do m=1,ao_prim_num(i)
beta = ao_expo_ordered_transp(m,i)
double precision :: c
c = 0.d0
if (dabs(ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i))&
@ -93,7 +124,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_local, (ao_num,ao_num)]
cycle
endif
do k = 1, nucl_num
double precision :: Z
Z = nucl_charge(k)
C_center(1:3) = nucl_coord(k,1:3)
@ -137,25 +167,28 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_local, (ao_num,ao_num)]
integer :: num_A,num_B
double precision :: A_center(3),B_center(3),C_center(3)
integer :: power_A(3),power_B(3)
integer :: i,j,k,l,n_pt_in,m
integer :: i,j,k,l,m
double precision :: Vloc, Vpseudo
integer :: omp_get_thread_num
double precision :: cpu_1, cpu_2, wall_1, wall_2, wall_0
double precision :: wall_1, wall_2, wall_0
integer :: thread_num
double precision :: c
double precision :: Z
PROVIDE ao_coef_normalized_ordered_transp
PROVIDE pseudo_lmax pseudo_kmax pseudo_v_kl_transp pseudo_n_kl_transp pseudo_dz_kl_transp
ao_pseudo_integrals_non_local = 0.d0
print*, 'Providing the nuclear electron pseudo integrals (non-local)'
call wall_time(wall_1)
call cpu_time(cpu_1)
thread_num = 0
!$OMP PARALLEL &
!$OMP DEFAULT (NONE) &
!$OMP PRIVATE (i,j,k,l,m,alpha,beta,A_center,B_center,C_center,power_A,power_B,&
!$OMP num_A,num_B,Z,c,n_pt_in, &
!$OMP num_A,num_B,Z,c, &
!$OMP wall_0,wall_2,thread_num) &
!$OMP SHARED (ao_num,ao_prim_num,ao_expo_ordered_transp,ao_power,ao_nucl,nucl_coord,ao_coef_normalized_ordered_transp,&
!$OMP ao_pseudo_integrals_non_local,nucl_num,nucl_charge,&
@ -184,7 +217,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_local, (ao_num,ao_num)]
do m=1,ao_prim_num(i)
beta = ao_expo_ordered_transp(m,i)
double precision :: c
c = 0.d0
if (dabs(ao_coef_normalized_ordered_transp(l,j)*ao_coef_normalized_ordered_transp(m,i))&
@ -193,7 +225,6 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integrals_local, (ao_num,ao_num)]
endif
do k = 1, nucl_num
double precision :: Z
Z = nucl_charge(k)
C_center(1:3) = nucl_coord(k,1:3)

View File

@ -666,7 +666,7 @@ double precision int_prod_bessel_loc,binom_func,accu,prod,ylm,bigI,arg
ac=dsqrt((a(1)-c(1))**2+(a(2)-c(2))**2+(a(3)-c(3))**2)
bc=dsqrt((b(1)-c(1))**2+(b(2)-c(2))**2+(b(3)-c(3))**2)
arg=g_a*ac**2+g_b*bc**2
if(arg.gt.-dlog(10.d-20))then
if(arg.gt.-dlog(1.d-20))then
Vloc=0.d0
return
endif
@ -1839,7 +1839,7 @@ double precision function int_prod_bessel(l,gam,n,m,a,b,arg)
m_1 = m+m+1
nlm = n+m+l
pi=dacos(-1.d0)
a_over_b_square = (a/b)**2
a_over_b_square = (a*a)/(b*b)
! First term of the sequence

View File

@ -2,7 +2,7 @@
# Stage 1
# Configure QP2
./configure --install all --config ./config/travis.cfg || exit -1
./configure --download all --install all --config ./config/travis.cfg || exit -1
# Create cache
cd ../