Skip to content

Commit

Permalink
Develop (#10)
Browse files Browse the repository at this point in the history
* fixed laplacian of aos

* corrected the laplacians of aos

* added dft_one_e

* added new feature for new dft functionals

* changed the configure to add new functionals

* changed the configure

* added dft_one_e/README.rst

* added README.rst in new_functionals

* added source/programmers_guide/new_ks.rst

* Thesis Yann

* Added gmp installation in configure

* improved qp_e_conv_fci

* Doc

* Typos

* Added variance_max

* Fixed completion in qp_create

* modif TODO

* fixed DFT potential for n_states gt 1

* improved pot pbe

* trying to improve sr PBE

* fixed potential pbe

* fixed the vxc smashed for pbe sr and normal

* Comments in selection

* bug fixed by peter

* Fixed bug with zero beta electrons

* Update README.rst

* Update e_xc_new_func.irp.f

* Update links.rst

* Update quickstart.rst

* Update quickstart.rst

* updated cipsi

* Fixed energies of non-expected s2 (#9)

* Moved diag_algorithm in Davdison
  • Loading branch information
scemama authored Feb 22, 2019
1 parent f6e5b4a commit 49e9488
Show file tree
Hide file tree
Showing 152 changed files with 2,156 additions and 43,125 deletions.
31 changes: 28 additions & 3 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository <https://github.com/LCPQ/quantum_package>`_.

.. code:: bash
git clone https://github.com/LCPQ/quantum_package
git clone https://github.com/QuantumPackage/qp2
Before anything, go into your :file:`quantum_package` directory and run
Expand Down Expand Up @@ -43,6 +43,7 @@ Requirements
- `Zlib`_
- `GNU Patch`_
- |ZeroMQ| : networking library
- `GMP <https://gmplib.org/>`_ : Gnu Multiple Precision Arithmetic Library
- |OCaml| compiler with |OPAM| package manager
- |Ninja| : a parallel build system

Expand Down Expand Up @@ -84,6 +85,7 @@ The following packages are supported by the :command:`configure` installer:
* irpf90
* zeromq
* f77zmq
* gmp
* ocaml ( :math:`\approx` 10 minutes)
* ezfio
* docopt
Expand All @@ -110,11 +112,11 @@ 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|
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
(:command:`apt`, :command:`yum`, etc)
(:command:`apt`, :command:`yum`, etc).


Ninja
Expand Down Expand Up @@ -216,6 +218,29 @@ With Debian or Ubuntu, you can use
sudo apt install zlib1g-dev
GMP
---

GMP is the GNU Multiple Precision Arithmetic Library.

* Download the latest version of gmp here:
`<ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2>`_
and move it in the :file:`${QP_ROOT}/external` directory

* Extract the archive, go into the :file:`gmp-*` directory and run
the following commands

.. code:: bash
./configure --prefix=${QP_ROOT}
make
make install
With Debian or Ubuntu, you can use

.. code:: bash
sudo apt install libgmp-dev
OCaml
Expand Down
11 changes: 10 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,13 @@ Doc: plugins et qp_plugins

Ajouter les symetries dans devel

Compiler ezfio avec openmp

# Parallelize i_H_psi


IMPORTANT:

Davidson Diagonalization
------------------------

Not enough memory: aborting in davidson_diag_hjj_sjj
95 changes: 87 additions & 8 deletions bin/qp_e_conv_fci
Original file line number Diff line number Diff line change
@@ -1,19 +1,96 @@
#!/bin/bash
file=$1

# Check the QP_ROOT directory
if [[ -z ${QP_ROOT} ]] ; then
>&2 echo "please source quantum_package.rc"
exit 1
fi

source ${QP_ROOT}/quantum_package.rc

qp_run print_e_conv $1
nstates=`cat ${1}/determinants/n_states`
TEMP=$(getopt -o h -l ,help -n $0 -- "$@") || exit 1 # get the input / options
eval set -- "$TEMP"

function help(){
cat <<EOF
Check the convergence of a CIPSI calculation
Usage:
$(basename $0) EZFIO
Output:
For each ELECTRONIC STATE \$i, produces plain text files
* for the convergence of the TOTAL variational and E+PT2 energies
files EZFIO.\$i.conv
* gnuplot file to generate pdf image of the converge
files EZFIO.\$i.conv.plt
* if gnuplot is available, creates the pdf image
files EZFIO.\$i.conv.pdf
For each EXCITED STATE \$i, produces plain text files
* for the convergence of the ENERGY DIFFERENCE with the ground state
files EZFIO.\$i.delta_e.conv
* gnuplot file to generate pdf image of the converge
files EZFIO.\$i.delta_e.conv.plt
* if gnuplot is available, creates the pdf image
files EZFIO.\$i.delta_e.conv.pdf
Note:
If you're in qpsh mode and that a EZFIO is set, this will be taken as the EZFIO file
Options:
-h, --help Print the HELP message
Example: ground state calculation on the EZFIO h2o.ezfio
$(basename $0) h2o.ezfio
produces h2o.ezfio.1.conv, h2o.ezfio.1.conv.plt and h2o.ezfio.1.conv.pdf if gnuplot is available
EOF
exit
}

while true ; do
case "$1" in
-h|-help|--help)
help
exit 0;;
--) shift ; break ;;
"") help ; break ;;
esac
done

ezfio=${1%/} # take off the / at the end

if [[ ! -z ${EZFIO_FILE} ]] ; then
file=${EZFIO_FILE}
else
file=$ezfio
fi


if [[ -z ${file} ]] ; then
>&2 echo "You did not specify any EZFIO directory. "
exit 1

fi


gnuplot_ok=`hash gnuplot`


qp_run print_e_conv $file
nstates=`cat ${file}/determinants/n_states`
echo $nstates


for i in $(seq 1 $nstates) ; do
out=${1}.${i}.conv
out=${file}.${i}.conv
cat << EOF > ${out}.plt
set term pdf
set output "$out.pdf"
Expand All @@ -25,13 +102,14 @@ plot "$out" w lp title "E_{var} state $i", "$out" u 1:3 w lp title "E_{var} + PT
EOF

gnuplot ${out}.plt
#rm ${out}.plt
if [[ -z ${gnuplot_ok} ]] ; then
gnuplot ${out}.plt
fi

done

for i in $(seq 2 $nstates) ; do
out=${1}.${i}.delta_e.conv
out=${file}.${i}.delta_e.conv
cat << EOF > ${out}.plt
set term pdf
set output "$out.pdf"
Expand All @@ -42,6 +120,7 @@ set ylabel "Energy difference (a.u.)"
plot "$out" w lp title "Delta E_{var} state $i", "$out" u 1:3 w lp title "Delta E_{var} + PT2 state $i"
EOF
if [[ -z ${gnuplot_ok} ]] ; then
gnuplot ${out}.plt
# rm ${out}.plt
fi
done
67 changes: 67 additions & 0 deletions config/cray.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Common flags
##############
#
# -mkl=[parallel|sequential] : Use the MKL library
# --ninja : Allow the utilisation of ninja. It is mandatory !
# --align=32 : Align all provided arrays on a 32-byte boundary
#
[COMMON]
FC : ftn -dynamic -fpic
LAPACK_LIB :
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 -DMPI
# For KNL, use:
#IRPF90_FLAGS : --ninja --align=64 -DMPI

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

# Optimization flags
####################
#
# -xHost : Compile a binary optimized for the current architecture
# -O2 : O3 not better than O2.
# -ip : Inter-procedural optimizations
# -ftz : Flushes denormal results to zero
#
[OPT]
FCFLAGS : -xCORE-AVX2 -O2 -ip -ftz -g -traceback -qopt-prefetch=5 -qopt-prefetch-issue-excl-hint -unroll-aggressive
#
#For KNL, use:
#FCFLAGS : -xMIC-AVX512 -O2 -ip -ftz -g -traceback -qopt-prefetch=5 -qopt-prefetch-issue-excl-hint -unroll-aggressive
#
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -qopt-prefetch

# Debugging flags
#################
#
# -traceback : Activate backtrace on runtime
# -fpe0 : All floating point exaceptions
# -C : Checks uninitialized variables, array subscripts, etc...
# -g : Extra debugging information
# -xSSE2 : Valgrind needs a very simple x86 executable
#
[DEBUG]
FC : -g -traceback
FCFLAGS : -xCORE-AVX2 -C -fpe0 -traceback

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

31 changes: 29 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ eval set -- "$TEMP"
export QP_ROOT="$( cd "$(dirname "$0")" ; pwd -P )"
echo "QP_ROOT="$QP_ROOT

# Check if the module to create new DFT functionals exists or not
if [[ ! -d ${QP_ROOT}/src/new_functionals ]] ; then
cp -r ${QP_ROOT}/scripts/functionals/do_not_touch_func ${QP_ROOT}/src/new_functionals
fi



function help()
{
Expand Down Expand Up @@ -175,7 +181,7 @@ if [[ "${PACKAGES}.x" != ".x" ]] ; then
fi

if [[ ${PACKAGES} = all ]] ; then
PACKAGES="zlib ninja irpf90 zeromq f77zmq ocaml ezfio docopt resultsFile bats"
PACKAGES="zlib ninja irpf90 zeromq f77zmq gmp ocaml ezfio docopt resultsFile bats"
fi


Expand All @@ -192,6 +198,21 @@ for PACKAGE in ${PACKAGES} ; do
EOF


elif [[ ${PACKAGE} = gmp ]] ; then

download \
"ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2" \
"${QP_ROOT}"/external/gmp.tar.bz2
execute << EOF
cd "\${QP_ROOT}"/external
tar --bzip2 --extract --file gmp.tar.bz2
rm gmp.tar.bz2
cd gmp*
./configure --prefix=$QP_ROOT && make -j 8
make install
EOF


elif [[ ${PACKAGE} = irpf90 ]] ; then

# When changing version of irpf90, don't forget to update etc/irpf90.rc
Expand Down Expand Up @@ -380,6 +401,12 @@ if [[ ${F77ZMQ} = $(not_found) ]] ; then
fail
fi

GMP=$(find_lib -lgmp)
if [[ ${ZLIB} = $(not_found) ]] ; then
error "GMP (gmp) is not installed."
fail
fi

OPAM=$(find_exe opam)
if [[ ${OPAM} = $(not_found) ]] ; then
error "OPAM (ocaml) package manager is not installed."
Expand Down Expand Up @@ -443,7 +470,7 @@ else
echo "See ./configure --help for more details."
echo ""
fi

exit 0


Expand Down
2 changes: 1 addition & 1 deletion docs/ref
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* option provider :option:`name_of_module provider`
* subroutine :c:func:`my_subroutine`
* module :ref:`module`
* provider :c:data:`my_subroutine`
* provider :c:data:`my_provider`
* qp_command :ref:`qp_command`
* linux command :command:`qp_command`
* linux command with option :command:`qp_command -o`
Expand Down
Loading

0 comments on commit 49e9488

Please sign in to comment.