diff --git a/.gitmodules b/.gitmodules index 73299cba..d250eddf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/INSTALL.rst b/INSTALL.rst index e12142db..229bf40a 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -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 `_ : Gnu Multiple Precision Arithmetic Library - |OCaml| compiler with |OPAM| package manager -- `Bubblewrap `_ : Sandboxing tool required by Opam -- `libcap `_ : 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 diff --git a/RELEASE_NOTES.org b/RELEASE_NOTES.org index 758618a9..1f746ec2 100644 --- a/RELEASE_NOTES.org +++ b/RELEASE_NOTES.org @@ -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 diff --git a/configure b/configure index b45bfd27..328d335a 100755 --- a/configure +++ b/configure @@ -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 < /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." diff --git a/etc/ocaml.rc b/etc/ocaml.rc index 1a1e5612..da6de03f 100644 --- a/etc/ocaml.rc +++ b/etc/ocaml.rc @@ -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 diff --git a/external/Python/.gitignore b/external/Python/.gitignore index 1cd79fd6..e69de29b 100644 --- a/external/Python/.gitignore +++ b/external/Python/.gitignore @@ -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/ diff --git a/external/gmp-6.1.2.tar.bz2 b/external/gmp-6.1.2.tar.bz2 deleted file mode 100644 index 3b9b275c..00000000 Binary files a/external/gmp-6.1.2.tar.bz2 and /dev/null differ diff --git a/external/qp2-dependencies b/external/qp2-dependencies new file mode 160000 index 00000000..0e1ca913 --- /dev/null +++ b/external/qp2-dependencies @@ -0,0 +1 @@ +Subproject commit 0e1ca91313e4b6ba3ea042b6378c3ff483781fb1 diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index 707a6734..d66918e2 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -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 diff --git a/src/ao_one_e_ints/pot_ao_pseudo_ints.irp.f b/src/ao_one_e_ints/pot_ao_pseudo_ints.irp.f index 988bbe0a..24f43311 100644 --- a/src/ao_one_e_ints/pot_ao_pseudo_ints.irp.f +++ b/src/ao_one_e_ints/pot_ao_pseudo_ints.irp.f @@ -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) diff --git a/src/ao_one_e_ints/pseudopot.f90 b/src/ao_one_e_ints/pseudopot.f90 index 48e3803e..29389cbe 100644 --- a/src/ao_one_e_ints/pseudopot.f90 +++ b/src/ao_one_e_ints/pseudopot.f90 @@ -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 diff --git a/travis/configuration.sh b/travis/configuration.sh index 7b3f5423..f925107d 100755 --- a/travis/configuration.sh +++ b/travis/configuration.sh @@ -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 ../