9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-09-14 11:48:31 +02:00

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

This commit is contained in:
Anthony Scemama 2020-03-18 16:43:44 +01:00
commit 95bf96feb9
61 changed files with 794 additions and 1810 deletions

View File

@ -25,8 +25,8 @@ sets all the environment variables required for the normal operation of the
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 tell you)
source the :file:`quantum_package.rc` in order to load all environment variables and compile the |QP|.
Requirements
@ -36,7 +36,7 @@ Requirements
- Fortran compiler : GNU Fortran, Intel Fortran or IBM XL Fortran
- `GNU make`_
- `Autoconf`_
- `Python`_ > 2.6
- `Python`_ > 3.0
- |IRPF90| : Fortran code generator
- |EZFIO| : Easy Fortran Input/Output library generator
- |BLAS| and |LAPACK|
@ -44,7 +44,7 @@ Requirements
- `GNU Patch`_
- |ZeroMQ| : networking library
- `GMP <https://gmplib.org/>`_ : Gnu Multiple Precision Arithmetic Library
- |OCaml| compiler with |OPAM| package manager
- |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
@ -74,29 +74,29 @@ Help for installing external dependencies
Using the :command:`configure` executable
-----------------------------------------
The :command:`configure` executable can help you in installing the minimal dependencies you will need to compile the |QP|.
The command is to be used as follows:
The :command:`configure` executable can help you in installing the minimal dependencies you will need to compile the |QP|.
The command is to be used as follows:
.. code:: bash
./configure --install <package>
The following packages are supported by the :command:`configure` installer:
The following packages are supported by the :command:`configure` installer:
* ninja
* irpf90
* zeromq
* ninja
* irpf90
* zeromq
* f77zmq
* gmp
* libcap
* bwrap
* ocaml ( :math:`\approx` 10 minutes)
* ezfio
* docopt
* resultsFile
* ezfio
* docopt
* resultsFile
* bats
Example:
Example:
.. code:: bash
@ -115,7 +115,7 @@ Example:
If the :command:`configure` executable fails to install a specific dependency
-----------------------------------------------------------------------------
If the :command:`configure` executable does not succeed 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|.
@ -140,7 +140,7 @@ IRPF90
------
*IRPF90* is a Fortran code generator for programming using the Implicit Reference
to Parameters (IRP) method.
to Parameters (IRP) method.
* Download the latest version of IRPF90
here : `<https://gitlab.com/scemama/irpf90/-/archive/v1.7.2/irpf90-v1.7.2.tar.gz>`_ and move
@ -312,26 +312,26 @@ OCaml
`<https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh>`_
and move it in the :file:`${QP_ROOT}/external` directory
* If you use OCaml only with the |qp|, you can install the OPAM directory
* If you use OCaml only with the |qp|, you can install the OPAM directory
containing the compiler and all the installed libraries in the
:file:`${QP_ROOT}/external` directory as
.. code:: bash
export OPAMROOT=${QP_ROOT}/external/opam
* Run the installer
.. code:: bash
echo ${QP_ROOT}/bin
${QP_ROOT}/external/opam_installer.sh --no-backup --fresh
The :command:`opam` command can be installed in the :file:`${QP_ROOT}/bin`
directory. To do this, take the output of ``echo ${QP_ROOT}/bin`` and
use it as an answer to where :command:`opam` should be installed.
* Install the OCaml compiler
@ -370,11 +370,11 @@ Docopt
*Docopt* is a Python package defining a command-line interface description language.
If you have *pip* for Python2, you can do
If you have *pip* for Python3, you can do
.. code:: bash
pip2 install --user docopt
python3 -m pip install --user docopt
Otherwise,

969
REPLACE

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@ -12,7 +12,7 @@ Usage:
"""
from __future__ import print_function
import sys
import os
import subprocess

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
"""
convert output of GAMESS/GAU$$IAN to ezfio
@ -22,7 +22,7 @@ try:
QP_ROOT = os.environ["QP_ROOT"]
QP_EZFIO = os.environ["QP_EZFIO"]
except KeyError:
print "Error: QP_ROOT environment variable not found."
print("Error: QP_ROOT environment variable not found.")
sys.exit(1)
else:
sys.path = [QP_EZFIO + "/Python",
@ -30,10 +30,11 @@ else:
QP_ROOT + "/install",
QP_ROOT + "/scripts"] + sys.path
from resultsFile import *
try:
from resultsFile import *
except:
print "Error: resultsFile Python library not installed"
print("Error: resultsFile Python library not installed")
sys.exit(1)
@ -48,17 +49,17 @@ def write_ezfio(res, filename):
# |_ | _ _ _|_ ._ _ ._ _
# |_ | (/_ (_ |_ | (_) | | _>
#
print "Electrons\t...\t",
print("Electrons\t...\t", end=' ')
ezfio.set_electrons_elec_alpha_num(res.num_alpha)
ezfio.set_electrons_elec_beta_num(res.num_beta)
print "OK"
print("OK")
#
# |\ | _ | _ o
# | \| |_| (_ | (/_ |
#
print "Nuclei\t\t...\t",
print("Nuclei\t\t...\t", end=' ')
# ~#~#~#~ #
# I n i t #
# ~#~#~#~ #
@ -93,24 +94,23 @@ def write_ezfio(res, filename):
# Transformt H1 into H
import re
p = re.compile(ur'(\d*)$')
p = re.compile(r'(\d*)$')
label = [p.sub("", x.name).capitalize() for x in res.geometry]
ezfio.set_nuclei_nucl_label(label)
ezfio.set_nuclei_nucl_coord(coord_x + coord_y + coord_z)
print "OK"
print("OK")
# _
# /\ _ _ |_) _. _ o _
# /--\ (_) _> |_) (_| _> | _>
#
print "AOS\t\t...\t",
print("AOS\t\t...\t", end=' ')
# ~#~#~#~ #
# I n i t #
# ~#~#~#~ #
import string
at = []
num_prim = []
power_x = []
@ -131,9 +131,9 @@ def write_ezfio(res, filename):
at.append(i + 1)
num_prim.append(len(b.prim))
s = b.sym
power_x.append(string.count(s, "x"))
power_y.append(string.count(s, "y"))
power_z.append(string.count(s, "z"))
power_x.append(str.count(s, "x"))
power_y.append(str.count(s, "y"))
power_z.append(str.count(s, "z"))
coefficient.append(b.coef)
exponent.append([p.expo for p in b.prim])
@ -175,14 +175,14 @@ def write_ezfio(res, filename):
ezfio.set_ao_basis_ao_expo(expo)
ezfio.set_ao_basis_ao_basis("Read by resultsFile")
print "OK"
print("OK")
# _
# |\/| _ _ |_) _. _ o _
# | | (_) _> |_) (_| _> | _>
#
print "MOS\t\t...\t",
print("MOS\t\t...\t", end=' ')
# ~#~#~#~ #
# I n i t #
# ~#~#~#~ #
@ -205,9 +205,9 @@ def write_ezfio(res, filename):
virtual = []
active = [(allMOs[i].eigenvalue, i) for i in range(len(allMOs))]
closed = map(lambda x: x[1], closed)
active = map(lambda x: x[1], active)
virtual = map(lambda x: x[1], virtual)
closed = [x[1] for x in closed]
active = [x[1] for x in active]
virtual = [x[1] for x in virtual]
MOindices = closed + active + virtual
MOs = []
@ -223,7 +223,7 @@ def write_ezfio(res, filename):
MOmap[i] = MOindices.index(i)
energies = []
for i in xrange(mo_num):
for i in range(mo_num):
energies.append(MOs[i].eigenvalue)
if res.occ_num is not None:
@ -237,11 +237,11 @@ def write_ezfio(res, filename):
MoMatrix = []
sym0 = [i.sym for i in res.mo_sets[MO_type]]
sym = [i.sym for i in res.mo_sets[MO_type]]
for i in xrange(len(sym)):
for i in range(len(sym)):
sym[MOmap[i]] = sym0[i]
MoMatrix = []
for i in xrange(len(MOs)):
for i in range(len(MOs)):
m = MOs[i]
for coef in m.vector:
MoMatrix.append(coef)
@ -256,10 +256,10 @@ def write_ezfio(res, filename):
ezfio.set_mo_basis_mo_num(mo_num)
ezfio.set_mo_basis_mo_occ(OccNum)
ezfio.set_mo_basis_mo_coef(MoMatrix)
print "OK"
print("OK")
print "Pseudos\t\t...\t",
print("Pseudos\t\t...\t", end=' ')
try:
lmax = 0
nucl_charge_remove = []
@ -327,7 +327,7 @@ def write_ezfio(res, filename):
else:
ezfio.set_pseudo_do_pseudo(True)
print "OK"
print("OK")
@ -354,15 +354,15 @@ if __name__ == '__main__':
except:
raise
else:
print FILE, 'recognized as', str(RES_FILE).split('.')[-1].split()[0]
print(FILE, 'recognized as', str(RES_FILE).split('.')[-1].split()[0])
write_ezfio(RES_FILE, EZFIO_FILE)
sys.stdout.flush()
if os.system("qp_run save_ortho_mos "+EZFIO_FILE) != 0:
print """Warning: You need to run
print("""Warning: You need to run
qp run save_ortho_mos
to be sure your MOs will be orthogonal, which is not the case when
the MOs are read from output files (not enough precision in output)."""
the MOs are read from output files (not enough precision in output).""")

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
"""
Displays the names of all the files in which the provider/subroutine/function
@ -30,7 +30,7 @@ try:
from docopt import docopt
from qp_path import QP_SRC, QP_ROOT
except ImportError:
print "source .quantum_package.rc"
print("source .quantum_package.rc")
raise
@ -38,7 +38,7 @@ def main(arguments):
"""Main function"""
# Check that name exist in */IRPF90_man
print "Checking that name exists..."
print("Checking that name exists...")
all_modules = os.listdir(QP_SRC)
f = arguments["<name>"]+".l"
@ -52,21 +52,21 @@ def main(arguments):
if found: break
if not found:
print "Error:"
print "The variable/subroutine/function \""+arguments["<name>"] \
+ "\" was not found in the sources."
print "Did you compile the code at the root?"
print "Continue? [y/N] ",
print("Error:")
print("The variable/subroutine/function \""+arguments["<name>"] \
+ "\" was not found in the sources.")
print("Did you compile the code at the root?")
print("Continue? [y/N] ", end=' ')
cont = sys.stdin.read(1).strip() in ["y", "Y"]
if not cont:
print "Aborted"
print("Aborted")
sys.exit(1)
# Now search in all the files
if arguments["--rename"]:
print "Replacing..."
print("Replacing...")
else:
print "Searching..."
print("Searching...")
name = re.compile(r"\b"+arguments["<name>"]+r"\b", re.IGNORECASE)
@ -84,15 +84,15 @@ def main(arguments):
with open(filename, "r") as f:
f_in = f.read()
if name.search(f_in):
print filename
print(filename)
if arguments["--rename"]:
f_new = name.sub(arguments["--rename"], f_in)
with open(filename, "w") as f:
f.write(f_new)
print "Done"
print("Done")
with open(os.path.join(QP_ROOT, "REPLACE"), 'a') as f:
print >>f, "qp_name "+" ".join(sys.argv[1:])
print("qp_name "+" ".join(sys.argv[1:]), file=f)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Usage:
@ -43,9 +43,9 @@ try:
from module_handler import get_l_module_descendant
from qp_path import QP_SRC, QP_PLUGINS, QP_DATA, QP_ROOT
except ImportError:
print "Please check if you have sourced the ${QP_ROOT}/quantum_package.rc"
print "(`source ${QP_ROOT}/quantum_package.rc`)"
print sys.exit(1)
print("Please check if you have sourced the ${QP_ROOT}/quantum_package.rc")
print("(`source ${QP_ROOT}/quantum_package.rc`)")
print(sys.exit(1))
def save_new_module(path, l_child):
@ -58,7 +58,7 @@ def save_new_module(path, l_child):
try:
os.makedirs(path)
except OSError:
print "The module ({0}) already exists...".format(path)
print("The module ({0}) already exists...".format(path))
sys.exit(1)
with open(os.path.join(path, "NEED"), "w") as f:
@ -105,7 +105,7 @@ def main(arguments):
if arguments["list"]:
if arguments["--repositories"]:
for repo in get_repositories():
print repo
print(repo)
else:
# Search in QP_PLUGINS all directories with a NEED file
@ -121,7 +121,7 @@ def main(arguments):
for (x, y) in l_tmp:
d_tmp[x] = y
repo_of_plugin[y] = x.replace(QP_PLUGINS+'/','')
l_repository = d_tmp.keys()
l_repository = list(d_tmp.keys())
if l_repository == []:
l_result = []
else:
@ -142,7 +142,7 @@ def main(arguments):
l_result = [f for f in l_plugins if f not in l_installed]
for module in sorted(l_result):
print "%-30s %-30s"%(module, repo_of_plugin[module])
print("%-30s %-30s"%(module, repo_of_plugin[module]))
if arguments["create"]:
@ -159,29 +159,29 @@ def main(arguments):
path = os.path.join(QP_PLUGINS, repository, name)
print "Created plugin:"
print path, '\n'
print("Created plugin:")
print(path, '\n')
for children in l_children:
if children not in m_instance.dict_descendant:
print "Error: {0} is not a valid module.".format(children)
print("Error: {0} is not a valid module.".format(children))
sys.exit(1)
print "Needed modules:"
print l_children, '\n'
print("Needed modules:")
print(l_children, '\n')
print "This corresponds to using the following modules:"
print l_children + m_instance.l_descendant_unique(l_children), '\n'
print("This corresponds to using the following modules:")
print(l_children + m_instance.l_descendant_unique(l_children), '\n')
print "Which is reduced to:"
print("Which is reduced to:")
l_child_reduce = m_instance.l_reduce_tree(l_children)
print l_child_reduce, '\n'
print(l_child_reduce, '\n')
print "Installation",
print("Installation", end=' ')
save_new_module(path, l_child_reduce)
print " [ OK ]"
print ""
print(" [ OK ]")
print("")
arguments["create"] = False
arguments["install"] = True
main(arguments)
@ -228,7 +228,7 @@ def main(arguments):
for (x, y) in [os.path.split(f) for f in l_tmp]:
d_repo_of_plugin[y] = x
d_repo[x] = None
l_repository = d_repo.keys()
l_repository = list(d_repo.keys())
d_plugin = get_dict_child(l_repository)
@ -236,7 +236,7 @@ def main(arguments):
d_child.update(d_plugin)
normalize_case = {}
for name in d_local.keys() + d_plugin.keys():
for name in list(d_local.keys()) + list(d_plugin.keys()):
normalize_case[name.lower()] = name
l_name = [normalize_case[name.lower()] for name in arguments["<name>"]]
@ -244,7 +244,7 @@ def main(arguments):
for name in l_name:
if name in d_local:
print "{0} Is already installed".format(name)
print("{0} Is already installed".format(name))
l_module_descendant = get_l_module_descendant(d_child, l_name)
@ -252,10 +252,10 @@ def main(arguments):
if l_module_to_cp:
print "Required dependencies:"
print l_module_to_cp
print("Required dependencies:")
print(l_module_to_cp)
print "Installation...",
print("Installation...", end=' ')
for module_to_cp in l_module_to_cp:
src = os.path.join(d_repo_of_plugin[module_to_cp], module_to_cp)
@ -269,10 +269,10 @@ def main(arguments):
subprocess.check_call([install])
os.chdir(wd)
except OSError:
print "The src directory is broken. Please remove %s" % des
print("The src directory is broken. Please remove %s" % des)
raise
subprocess.check_call(["qp_create_ninja", "update"])
print "[ OK ]"
print("[ OK ]")
elif arguments["uninstall"]:
@ -285,17 +285,17 @@ def main(arguments):
l_failed = [name for name in l_name if name not in d_local]
if l_failed:
print "Plugins not installed:"
print("Plugins not installed:")
for name in sorted(l_failed):
print "%s" % name
print("%s" % name)
sys.exit(1)
l_name_to_remove = l_name + \
[module for module in m_instance.l_module \
for name in l_name if name in d_descendant[module]]
print "Removing plugins:"
print l_name_to_remove
print("Removing plugins:")
print(l_name_to_remove)
for module in set(l_name_to_remove):
@ -310,7 +310,7 @@ def main(arguments):
try:
os.unlink(os.path.join(QP_SRC, module))
except OSError:
print "%s is a core module which can't be removed" % module
print("%s is a core module which can't be removed" % module)
elif arguments["update"]:
@ -321,7 +321,7 @@ def main(arguments):
l_repositories = get_repositories()
for repo in l_repositories:
print "Updating ", repo
print("Updating ", repo)
os.chdir(os.path.join(QP_PLUGINS,repo))
git_cmd=["git", "pull"]
subprocess.check_call(git_cmd)

View File

@ -95,6 +95,7 @@ qp set_file $ezfio
if [[ $dets -eq 1 ]] ; then
rm --force -- ${ezfio}/determinants/n_det
rm --force -- ${ezfio}/determinants/psi_{det,coef}.gz
rm --force -- ${ezfio}/determinants/psi_{det,coef}_qp_edit.gz
fi
if [[ $mos -eq 1 ]] ; then

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
"""
@ -49,7 +49,7 @@ import os.path
try:
import qp_path
except ImportError:
print "source .quantum_package.rc"
print("source .quantum_package.rc")
raise
from docopt import docopt
@ -102,7 +102,7 @@ def main(arguments):
mo_num = ezfio.mo_basis_mo_num
if arguments["--query"]:
print n_frozen
print(n_frozen)
sys.exit(0)
if n_frozen == 0:

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
"""
@ -23,7 +23,7 @@ import os.path
try:
import qp_path
except ImportError:
print "source .quantum_package.rc"
print("source .quantum_package.rc")
raise
from docopt import docopt
@ -62,7 +62,7 @@ def main(arguments):
mo_num = ezfio.mo_basis_mo_num
if arguments["--query"]:
print n_frozen
print(n_frozen)
sys.exit(0)
if n_frozen == 0:

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@ -21,8 +21,8 @@ try:
from docopt import docopt
from qp_path import QP_SRC, QP_TESTS
except ImportError:
print "Please check if you have sourced the ${QP_ROOT}/quantum_package.rc"
print "(`source ${QP_ROOT}/quantum_package.rc`)"
print("Please check if you have sourced the ${QP_ROOT}/quantum_package.rc")
print("(`source ${QP_ROOT}/quantum_package.rc`)")
sys.exit(1)
@ -54,11 +54,11 @@ def main(arguments):
os.chdir(QP_TESTS)
for bats_file in l_bats:
print ""
print "-~-~-~-~-~-~"
print ""
print "Running tests for %s"%(bats_file)
print ""
print("")
print("-~-~-~-~-~-~")
print("")
print("Running tests for %s"%(bats_file))
print("")
if arguments["-v"]:
p = None
if arguments["TEST"]:
@ -66,7 +66,7 @@ def main(arguments):
else:
test = ""
try:
os.system(test+" python2 bats_to_sh.py "+bats_file+
os.system(test+" python3 bats_to_sh.py "+bats_file+
"| bash")
except:
if p:

View File

@ -9,14 +9,14 @@
FC : ifort -fpic
LAPACK_LIB : -mkl=parallel
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32
IRPF90_FLAGS : --ninja --align=32
# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
#
[OPTION]
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 0 ; Enable cache_compile.py
@ -32,14 +32,14 @@ OPENMP : 1 ; Append OpenMP flags
#
[OPT]
FC : -traceback
FCFLAGS : -xAVX -O2 -ip -ftz -g
FCFLAGS : -mavx -axAVX -O2 -ip -ftz -g
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz
FCFLAGS : -xSSE4.2 -O2 -ip -ftz
# Debugging flags
#################

View File

@ -9,14 +9,14 @@
FC : mpiifort -fpic
LAPACK_LIB : -mkl=parallel
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 -DMPI
IRPF90_FLAGS : --ninja --align=32 -DMPI
# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
#
[OPTION]
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 0 ; Enable cache_compile.py
@ -31,14 +31,14 @@ OPENMP : 1 ; Append OpenMP flags
# -ftz : Flushes denormal results to zero
#
[OPT]
FCFLAGS : -march=corei7-avx -O2 -ip -ftz -g -traceback
FCFLAGS : -mavx -axAVX -O2 -ip -ftz -g -traceback
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -march=corei7 -O2 -ip -ftz
FCFLAGS : -march=corei7 -O2 -ip -ftz
# Debugging flags

View File

@ -32,7 +32,7 @@ OPENMP : 1 ; Append OpenMP flags
#
[OPT]
FC : -traceback
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g
FCFLAGS : -msse4.2 -O2 -ip -ftz -g
# Profiling flags
@ -40,7 +40,7 @@ FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g
#
[PROFILE]
FC : -p -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz
FCFLAGS : -msse4.2 -O2 -ip -ftz
# Debugging flags
@ -50,11 +50,11 @@ FCFLAGS : -xSSE4.2 -O2 -ip -ftz
# -fpe0 : All floating point exaceptions
# -C : Checks uninitialized variables, array subscripts, etc...
# -g : Extra debugging information
# -xSSE2 : Valgrind needs a very simple x86 executable
# -msse4.2 : Valgrind needs a very simple x86 executable
#
[DEBUG]
FC : -g -traceback
FCFLAGS : -xSSE4.2 -C -fpe0 -implicitnone
FCFLAGS : -msse4.2 -C -fpe0 -implicitnone
# OpenMP flags

View File

@ -1,63 +0,0 @@
# 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 : ifort -fpic
LAPACK_LIB : -mkl=parallel
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32
# 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]
FC : -traceback
FCFLAGS : -march=core-avx2 -O2 -ip -ftz -g
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -march=core-avx2 -O2 -ip -ftz
# 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 : -xSSE2 -C -fpe0 -implicitnone
# OpenMP flags
#################
#
[OPENMP]
FC : -qopenmp
IRPF90_FLAGS : --openmp

View File

@ -9,14 +9,14 @@
FC : mpiifort -fpic
LAPACK_LIB : -mkl=parallel
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 -DMPI
IRPF90_FLAGS : --ninja --align=32 -DMPI
# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
#
[OPTION]
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 0 ; Enable cache_compile.py
@ -31,14 +31,14 @@ OPENMP : 1 ; Append OpenMP flags
# -ftz : Flushes denormal results to zero
#
[OPT]
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g -traceback
FCFLAGS : -msse4.2 -O2 -ip -ftz -g -traceback
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz
FCFLAGS : -msse4.2 -O2 -ip -ftz
# Debugging flags

91
configure vendored
View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
#
# Quantum Package configuration script
#
@ -15,20 +15,20 @@ unset CCXX
export CC=gcc
# When updating version, update also etc files
# /!\ When updating version, update also etc files
EZFIO_TGZ="EZFIO.2.0.2.tar.gz"
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"
EZFIO_URL="https://gitlab.com/scemama/EZFIO/-/archive/v1.6.1/EZFIO-v1.6.1.tar.gz"
F77ZMQ_URL="https://github.com/scemama/f77_zmq/archive/v4.2.5.tar.gz"
GMP_URL="ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2"
IRPF90_URL="https://gitlab.com/scemama/irpf90/-/archive/v1.7.6/irpf90-v1.7.6.tar.gz"
IRPF90_URL="https://gitlab.com/scemama/irpf90/-/archive/v2.0.0/irpf90-v2.0.0.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/v1.0/resultsFile-v1.0.tar.gz"
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"
@ -45,7 +45,7 @@ Usage:
Options:
-c, --config=<file> Define a COMPILATION configuration file,
in "${QP_ROOT}/config/".
in "${QP_ROOT}/config/".
-h, --help Print the HELP message
-i, --install=<package> INSTALL <package>. Use at your OWN RISK:
no support will be provided for the installation of
@ -73,7 +73,7 @@ function execute () {
while read -r line; do
echo " " $line
_command+="${line} ;"
done
done
sleep 1
echo ""
printf "\e[0;94m"
@ -87,7 +87,7 @@ OCAML_PACKAGES="ocamlbuild cryptokit zmq sexplib ppx_sexp_conv ppx_deriving geto
while true ; do
case "$1" in
-c|--config)
-c|--config)
case "$2" in
"") help ; break;;
*) if [[ -f $2 ]] ; then
@ -96,15 +96,15 @@ while true ; do
error "error: configuration file $2 not found."
exit 1
fi
esac
esac
shift 2;;
-i|--install)
case "$2" in
"") help ; break;;
*) PACKAGES="${PACKAGE} $2"
esac
esac
shift 2;;
-h|-help|--help)
-h|-help|--help)
help
exit 0;;
--) shift ; break ;;
@ -154,7 +154,7 @@ function find_exe() {
}
function find_python_lib() {
python2 -c "import $1" &> /dev/null && echo "$1" || not_found
python3 -c "import $1" &> /dev/null && echo "$1" || not_found
}
function find_lib() {
@ -178,6 +178,19 @@ function find_dir() {
}
# Extract EZFIO if needed
EZFIO=$(find_dir "${QP_ROOT}"/external/ezfio)
if [[ ${EZFIO} = $(not_found) ]] ; then
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file ${EZFIO_TGZ}
rm -rf ezfio
mv EZFIO ezfio
EOF
fi
if [[ "${PACKAGES}.x" != ".x" ]] ; then
printf "\e[0;31m"
echo ""
@ -224,7 +237,7 @@ EOF
./configure --prefix=$QP_ROOT && make -j 8
make install
EOF
elif [[ ${PACKAGE} = libcap ]] ; then
download ${LIBCAP_URL} "${QP_ROOT}"/external/libcap.tar.gz
@ -259,12 +272,14 @@ EOF
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
@ -290,7 +305,7 @@ EOF
cp f77_zmq_free.h "\${QP_ROOT}"/include
EOF
elif [[ ${PACKAGE} = ocaml ]] ; then
download ${OCAML_URL} "${QP_ROOT}"/external/opam_installer.sh
@ -303,7 +318,7 @@ EOF
rm -rf ${HOME}/.opam
fi
export OPAMROOT=${HOME}/.opam
cat << EOF | bash ${QP_ROOT}/external/opam_installer.sh --no-backup
cat << EOF | bash ${QP_ROOT}/external/opam_installer.sh --no-backup
${QP_ROOT}/bin
@ -313,8 +328,8 @@ 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.07.1
opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing
# opam switch create ocaml-base-compiler.4.10.0
opam init --verbose --yes --compiler=4.10.0 --disable-sandboxing
eval $(opam env)
opam install -y ${OCAML_PACKAGES} || exit 1
@ -323,37 +338,25 @@ EOF
# Conventional commands
execute << EOF
chmod +x "${QP_ROOT}"/external/opam_installer.sh
"${QP_ROOT}"/external/opam_installer.sh --no-backup
"${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
| 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.07.1 || exit 1
# opam switch create ocaml-base-compiler.4.10.0 || exit 1
opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing
opam init --verbose --yes --compiler=4.10.0 --disable-sandboxing
eval $(opam env)
execute << EOF
opam install -y \${OCAML_PACKAGES} || exit 1
EOF
fi
elif [[ ${PACKAGE} = ezfio ]] ; then
download ${EZFIO_URL} "${QP_ROOT}"/external/ezfio.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar --gunzip --extract --file ezfio.tar.gz
rm -f ezfio.tar.gz
rm -rf ezfio
mv EZFIO-* ezfio
EOF
elif [[ ${PACKAGE} = bse ]] ; then
@ -375,13 +378,13 @@ EOF
make && make install
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 docopt.tar.gz
mv docopt-*/docopt.py "\${QP_ROOT}/external/Python"
rm --recursive --force -- docopt-*/ docopt.tar.gz
EOF
@ -392,7 +395,7 @@ EOF
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 resultsFile.tar.gz
mv resultsFile-*/resultsFile "\${QP_ROOT}/external/Python/"
rm --recursive --force resultsFile-* resultsFile.tar.gz
EOF
@ -402,7 +405,7 @@ EOF
download ${BATS_URL} "${QP_ROOT}"/external/bats.tar.gz
execute << EOF
cd "\${QP_ROOT}"/external
tar -zxf bats.tar.gz
tar -zxf bats.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
@ -468,12 +471,6 @@ if [[ ${OCAML} = $(not_found) ]] ; then
fail
fi
EZFIO=$(find_dir "${QP_ROOT}"/external/ezfio)
if [[ ${EZFIO} = $(not_found) ]] ; then
error "EZFIO (ezfio) is not installed."
fail
fi
ZLIB=$(find_lib -lz)
if [[ ${ZLIB} = $(not_found) ]] ; then
error "Zlib (zlib) is not installed."
@ -520,15 +517,15 @@ fi
if [[ -f ${QP_ROOT}/build.ninja ]] ; then
[[ -z ${TRAVIS} ]] && echo "You can now run ./bin/qpsh to enter in the QP shell mode :)"
else
else
echo ""
echo "${QP_ROOT}/build.ninja does not exist,"
echo "you need to specify the COMPILATION configuration file."
echo "See ./configure --help for more details."
echo "See ./configure --help for more details."
echo ""
fi
exit 0

View File

@ -14,7 +14,7 @@ help:
.PHONY: help Makefile auto
auto:
cd source ; python2 auto_generate.py
cd source ; python3 auto_generate.py
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

View File

@ -1,9 +1,9 @@
#!/usr/bin/env python2
from __future__ import print_function
import os
import sys
import ConfigParser
import configparser
from module_handler import get_binaries
@ -27,7 +27,7 @@ def generate_modules(abs_module, entities):
EZFIO = os.path.join(abs_module,'EZFIO.cfg')
if os.path.exists(EZFIO):
rst += ["", "EZFIO parameters", "----------------", ""]
config_file = ConfigParser.ConfigParser()
config_file = configparser.ConfigParser()
with open(EZFIO, 'r') as f:
config_file.readfp(f)
for section in config_file.sections():

View File

@ -1,7 +1,7 @@
# Configuration of IRPF90 package
# Set the path of IRPF90 here:
export IRPF90_PATH=${QP_ROOT}/external/irpf90-v1.7.6
export IRPF90_PATH=${QP_ROOT}/external/irpf90-v2.0.0
export PATH=${PATH}:${IRPF90_PATH}/bin
export IRPF90=${IRPF90_PATH}/bin/irpf90
@ -10,10 +10,10 @@ function source_if_exists() {
if [[ -f $1 ]]; then
cd $(dirname $1) ; source $(basename $1) ; cd -
fi &> /dev/null
}
}
source ${QP_ROOT}/etc/autocomplete.rc
source_if_exists "${IRPF90_PATH}/irpman-completions.bash"

View File

@ -38,5 +38,6 @@ export LD_LIBRARY_PATH=$(qp_prepend_export "LD_LIBRARY_PATH" "${QP_ROOT}"/lib)
export LIBRARY_PATH=$(qp_prepend_export "LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)
export C_INCLUDE_PATH=$(qp_prepend_export "C_INCLUDE_PATH" "${QP_ROOT}"/include)
export CPATH=$(qp_prepend_export "CPATH" "${QP_ROOT}"/include)

BIN
external/EZFIO.2.0.2.tar.gz vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,46 @@
# 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/

View File

@ -21,10 +21,6 @@ let () =
doc="Downloads the EZFIO directory." ;
arg=Without_arg; } ;
{ short='v' ; long="verbose" ; opt=Optional ;
doc="Prints the transfer speed." ;
arg=Without_arg; } ;
anonymous
"(EZFIO_DIR|ADDRESS)"
Mandatory
@ -150,45 +146,6 @@ let () =
Zmq.Socket.subscribe socket_in "";
(*
let action =
if verbose then
begin
match req_or_sub with
| REQ -> (fun () ->
let msg =
Zmq.Socket.recv_all socket_in
in
let t0 = Unix.gettimeofday () in
Zmq.Socket.send_all socket_out msg;
let in_size =
float_of_int ( List.fold_left (fun accu x -> accu + String.length x) 0 msg )
/. 8192. /. 1024.
in
let msg =
Zmq.Socket.recv_all socket_out
in
let t1 = Unix.gettimeofday () in
Zmq.Socket.send_all socket_in msg;
let in_time = t1 -. t0 in
in_time_sum := !in_time_sum +. in_time;
in_size_sum := !in_size_sum +. in_size;
Printf.printf " %16.2f MiB/s -- %16.2f MiB/s\n%!" (in_size /. in_time) (!in_size_sum /. !in_time_sum);
)
| SUB -> (fun () ->
Zmq.Socket.recv_all socket_in |> Zmq.Socket.send_all socket_out)
end
else
begin
match req_or_sub with
| REQ -> (fun () ->
Zmq.Socket.recv_all socket_in |> Zmq.Socket.send_all socket_out;
Zmq.Socket.recv_all socket_out |> Zmq.Socket.send_all socket_in )
| SUB -> (fun () ->
Zmq.Socket.recv_all socket_in |> Zmq.Socket.send_all socket_out)
end
in
*)
let action_in =
match req_or_sub with

View File

@ -219,22 +219,19 @@ module Perturbation : sig
end = struct
type t =
| EN
| Barycentric
| Variance
| HF
| SOP
[@@deriving sexp]
let to_string = function
| EN -> \"EN\"
| Variance -> \"Variance\"
| Barycentric -> \"Barycentric\"
| HF -> \"HF\"
| SOP -> \"SOP\"
let of_string s =
match (String.lowercase_ascii s) with
| \"sop\" -> SOP
| \"en\" -> EN
| \"variance\" -> Variance
| \"barycentric\" -> Barycentric
| \"hf\" -> HF
| _ -> raise (Invalid_argument (\"Wrong Perturbation type : \"^s))
end
"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
"""
Save the .o from a .f90
and is the .o is asked a second time, retur it
@ -13,9 +13,9 @@ import re
import shutil
import subprocess
r = re.compile(ur'-c\s+(\S+\.[fF]90)\s+-o\s+(\S+\.o)')
p = re.compile(ur'-I IRPF90_temp/\S*\s+')
mod = re.compile(ur'module\s+(?P<mod>\S+).+end\s?module\s+(?P=mod)?',
r = re.compile(r'-c\s+(\S+\.[fF]90)\s+-o\s+(\S+\.o)')
p = re.compile(r'-I IRPF90_temp/\S*\s+')
mod = re.compile(r'module\s+(?P<mod>\S+).+end\s?module\s+(?P=mod)?',
re.MULTILINE | re.IGNORECASE)
tmpdir_root = os.environ.get("TMPDIR", failobj="/dev/shm")

View File

@ -1,4 +1,4 @@