mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-23 12:56:14 +01:00
Cleaning but qp_ninja is now long...
This commit is contained in:
parent
21997f9463
commit
62ef20c607
@ -12,7 +12,7 @@ before_script:
|
|||||||
script:
|
script:
|
||||||
- ./setup_environment.sh --robot
|
- ./setup_environment.sh --robot
|
||||||
- source ./quantum_package.rc
|
- source ./quantum_package.rc
|
||||||
- ./scripts/compilation/create_ninja_build.py --production ./config/gfortran_example.cfg
|
- qp_create_ninja.py --production ./config/gfortran_example.cfg
|
||||||
- ./ninja/ninja
|
- ninja
|
||||||
- cd ocaml ; make ; cd -
|
- cd ocaml ; make ; cd -
|
||||||
- cd testing_no_regression ; ./unit_test.py
|
- cd testing_no_regression ; ./unit_test.py
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
Usage: create_ninja_build.py (--development | --production) CONFIG_FILE
|
Usage: qp_create_ninja.py (--development | --production) CONFIG_FILE
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@ -12,7 +12,7 @@ from collections import namedtuple
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from module_handler import get_dict_module_boss, get_dict_genealogy_desc
|
from module_handler import ModuleHandler
|
||||||
from read_compilation_cfg import get_compilation_option
|
from read_compilation_cfg import get_compilation_option
|
||||||
from docopt import docopt
|
from docopt import docopt
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -307,26 +307,21 @@ def get_l_file_for_module(path_module_abs):
|
|||||||
l_template = []
|
l_template = []
|
||||||
|
|
||||||
for f in os.listdir(path_module_abs):
|
for f in os.listdir(path_module_abs):
|
||||||
if f.endswith(".template.f"):
|
if f.lower().endswith(tuple([".template.f", ".include.f"])):
|
||||||
l_template.append(join(path_module_abs, f))
|
l_template.append(join(path_module_abs, f))
|
||||||
elif f.endswith(".irp.f"):
|
elif f.endswith(".irp.f"):
|
||||||
l_irp.append(join(path_module_abs, f))
|
l_irp.append(join(path_module_abs, f))
|
||||||
elif any(f.endswith("{0}".format(i)) for i in [".f",
|
elif f.lower().endswith(tuple([".f", ".f90", ".c", ".cpp", ".cxx"])):
|
||||||
".f90",
|
|
||||||
".c",
|
|
||||||
".cpp",
|
|
||||||
".cxx"]):
|
|
||||||
l_src.append(join(path_module_abs, f))
|
l_src.append(join(path_module_abs, f))
|
||||||
obj = '{0}.o'.format(os.path.splitext(f)[0])
|
obj = '{0}.o'.format(os.path.splitext(f)[0])
|
||||||
l_obj.append(join(path_module_abs, obj))
|
l_obj.append(join(path_module_abs, obj))
|
||||||
elif f == "EZFIO.cfg":
|
elif f == "EZFIO.cfg":
|
||||||
l_irp.append(join(path_module_abs, "ezfio_interface.irp.f"))
|
l_irp.append(join(path_module_abs, "ezfio_interface.irp.f"))
|
||||||
|
|
||||||
d = dict()
|
d = {"l_irp": l_irp,
|
||||||
d["l_irp"] = l_irp
|
"l_src": l_src,
|
||||||
d["l_src"] = l_src
|
"l_obj": l_obj,
|
||||||
d["l_obj"] = l_obj
|
"l_template": l_template}
|
||||||
d["l_template"] = l_template
|
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
@ -459,7 +454,7 @@ def ninja_readme_build(path_module):
|
|||||||
# |_) o ._ _. ._
|
# |_) o ._ _. ._
|
||||||
# |_) | | | (_| | \/
|
# |_) | | | (_| | \/
|
||||||
# /
|
# /
|
||||||
def get_program(path_module):
|
def get_binaries(path_module):
|
||||||
"""
|
"""
|
||||||
Return the list of binaries (Path= namedtuple('Path', ['abs', 'rel']) for a module
|
Return the list of binaries (Path= namedtuple('Path', ['abs', 'rel']) for a module
|
||||||
"""
|
"""
|
||||||
@ -484,7 +479,7 @@ def get_program(path_module):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def get_dict_binaries(mode="production"):
|
def get_dict_binaries(l_module, mode="production"):
|
||||||
"""
|
"""
|
||||||
Return a dict [module] = list_binaries
|
Return a dict [module] = list_binaries
|
||||||
If a the production mode is enable only header module
|
If a the production mode is enable only header module
|
||||||
@ -497,20 +492,20 @@ def get_dict_binaries(mode="production"):
|
|||||||
|
|
||||||
# Create d_binaries
|
# Create d_binaries
|
||||||
# Ake module => binaries generated
|
# Ake module => binaries generated
|
||||||
for module in d_genealogy_path.keys():
|
for module in l_module:
|
||||||
l_binaries = get_program(module)
|
l_binaries = get_binaries(module)
|
||||||
|
|
||||||
if l_binaries:
|
if l_binaries:
|
||||||
d_binaries[module] += l_binaries
|
d_binaries[module] += l_binaries
|
||||||
|
|
||||||
if mode == "production":
|
if mode == "production":
|
||||||
|
|
||||||
dict_boss = get_dict_module_boss()
|
dict_root = ModuleHandler.dict_root
|
||||||
dict_boss_path = dict_module_genelogy_path(dict_boss)
|
dict_root_path = dict_module_genelogy_path(dict_root)
|
||||||
|
|
||||||
d_binaries_condensed = defaultdict(list)
|
d_binaries_condensed = defaultdict(list)
|
||||||
for module in d_binaries:
|
for module in d_binaries:
|
||||||
d_binaries_condensed[dict_boss_path[module]] += d_binaries[module]
|
d_binaries_condensed[dict_root_path[module]] += d_binaries[module]
|
||||||
|
|
||||||
d_binaries = d_binaries_condensed
|
d_binaries = d_binaries_condensed
|
||||||
|
|
||||||
@ -649,11 +644,14 @@ if __name__ == "__main__":
|
|||||||
# G e n e a l o g y _ d i c t #
|
# G e n e a l o g y _ d i c t #
|
||||||
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
||||||
|
|
||||||
d_genealogy = get_dict_genealogy_desc()
|
d_genealogy = ModuleHandler.dict_descendant
|
||||||
d_genealogy_path = dict_module_genelogy_path(d_genealogy)
|
d_genealogy_path = dict_module_genelogy_path(d_genealogy)
|
||||||
d_irp = get_file_dependency(d_genealogy_path)
|
d_irp = get_file_dependency(d_genealogy_path)
|
||||||
|
|
||||||
d_binaries_production = get_dict_binaries(mode="production")
|
l_module = d_genealogy_path.keys()
|
||||||
|
|
||||||
|
d_binaries_production = get_dict_binaries(l_module,
|
||||||
|
mode="production")
|
||||||
|
|
||||||
# ~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
# ~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
||||||
# M o d u l e _ t o _ i r p #
|
# M o d u l e _ t o _ i r p #
|
@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Prepares the EZFIO library before running make
|
|
||||||
# Wed Mar 25 21:25:11 CET 2015
|
|
||||||
|
|
||||||
echo "Building EZFIO library"
|
|
||||||
echo "=-=-=-=-=-=-=-=-=-=-=-"
|
|
||||||
|
|
||||||
# Interpret all the EZFIO.cfg files
|
|
||||||
for dir in ${QPACKAGE_ROOT}/src/*/
|
|
||||||
do
|
|
||||||
cd $dir || exit -1
|
|
||||||
${QPACKAGE_ROOT}/scripts/ezfio_interface/ei_handler.py --ezfio_config --ezfio_default
|
|
||||||
done
|
|
||||||
|
|
||||||
# For old-style directories. Will be removed some day...
|
|
||||||
cp ${QPACKAGE_ROOT}/src{/*,}/*.ezfio_config ${QPACKAGE_ROOT}/EZFIO/config
|
|
||||||
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# This script should run from the directory $QPACKAGE_ROOT/src
|
|
||||||
|
|
||||||
# Check is we are in `QPACKAGE_ROOT_SRC` and all the dependency are correct
|
|
||||||
${QPACKAGE_ROOT}/scripts/module/check_src.sh
|
|
||||||
|
|
||||||
NPROC=$(cat /proc/cpuinfo | grep MHz | wc -l)
|
|
||||||
|
|
||||||
export IN_MAKE=1
|
|
||||||
|
|
||||||
for MODULE in $@
|
|
||||||
do
|
|
||||||
if [[ ! -d ${MODULE} ]]
|
|
||||||
then
|
|
||||||
error "Module ${MODULE} doesn't exist"
|
|
||||||
fi
|
|
||||||
cd ${MODULE}
|
|
||||||
echo ${MODULE}
|
|
||||||
|
|
||||||
if [[ $# -eq 1 ]]
|
|
||||||
then
|
|
||||||
env make -j ${NPROC} all
|
|
||||||
else
|
|
||||||
env make -j ${NPROC} all &> make.log
|
|
||||||
if [[ $? -ne 0 ]]
|
|
||||||
then
|
|
||||||
cat make.log
|
|
||||||
error "
|
|
||||||
Build failed for module $MODULE
|
|
||||||
"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ${OLDPWD}
|
|
||||||
done
|
|
||||||
${QPACKAGE_ROOT}/scripts/module/create_executables_list.sh
|
|
@ -14,7 +14,7 @@ function do_clean()
|
|||||||
{
|
{
|
||||||
rm -rf -- \
|
rm -rf -- \
|
||||||
IRPF90_temp IRPF90_man Makefile.depend \
|
IRPF90_temp IRPF90_man Makefile.depend \
|
||||||
$(module_handler.py print_genealogy) include \
|
$(module_handler.py print_descendant) include \
|
||||||
ezfio_interface.irp.f irpf90.make irpf90_entities tags $(ls_exe) *.mod
|
ezfio_interface.irp.f irpf90.make irpf90_entities tags $(ls_exe) *.mod
|
||||||
|
|
||||||
touch -c EZFIO.cfg *.ezfio_config
|
touch -c EZFIO.cfg *.ezfio_config
|
||||||
|
@ -6,44 +6,31 @@ Create the NEEDED_MODULE
|
|||||||
of a NEEDED_CHILDREN_MODULES file
|
of a NEEDED_CHILDREN_MODULES file
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
module_handler.py print_genealogy [<NEEDED_CHILDREN_MODULES>]
|
module_handler.py print_descendant [<NEEDED_CHILDREN_MODULES>]
|
||||||
module_handler.py create_png [<NEEDED_CHILDREN_MODULES>]
|
module_handler.py create_png [<NEEDED_CHILDREN_MODULES>]
|
||||||
module_handler.py head_module
|
module_handler.py head_module
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
print_genealogy Print the genealogy of the NEEDED_CHILDREN_MODULES
|
print_descendant Print the genealogy of the NEEDED_CHILDREN_MODULES
|
||||||
aka (children, subchildren, etc)
|
aka (children, subchildren, etc)
|
||||||
create_png Create a png of the file
|
create_png Create a png of the file
|
||||||
NEEDED_CHILDREN_MODULES The path of NEEDED_CHILDREN_MODULES
|
NEEDED_CHILDREN_MODULES The path of NEEDED_CHILDREN_MODULES
|
||||||
by default try to open the file in the current path
|
by default try to open the file in the current path
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from docopt import docopt
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import os.path
|
import os.path
|
||||||
from cache import cache
|
|
||||||
|
|
||||||
from collections import namedtuple
|
try:
|
||||||
Dependency = namedtuple('Dependency', ['src', 'obj'])
|
from docopt import docopt
|
||||||
Module_info = namedtuple('Module_info', ['l_children', 'l_dependency'])
|
from decorator import classproperty
|
||||||
|
except ImportError:
|
||||||
|
print "source .quantum_package.rc"
|
||||||
def get_list_from_makefile(data, sep):
|
raise
|
||||||
# Split for sep
|
|
||||||
dump = [l.split(sep)[1] for l in data if l.startswith(sep)]
|
|
||||||
|
|
||||||
# Delete the empy one
|
|
||||||
l_unique = [k for k in map(str.strip, dump) if k]
|
|
||||||
|
|
||||||
# Return the flat one (if multi in l_unique)
|
|
||||||
l_flat = [j for i in l_unique for j in i.split()]
|
|
||||||
return l_flat
|
|
||||||
|
|
||||||
|
|
||||||
# Canot cache for namedtuple are not hashable
|
# Canot cache for namedtuple are not hashable
|
||||||
def get_dict_genealogy():
|
def get_dict_child():
|
||||||
"""Loop over MODULE in QPACKAGE_ROOT/src, open all the NEEDED_CHILDREN_MODULES
|
"""Loop over MODULE in QPACKAGE_ROOT/src, open all the NEEDED_CHILDREN_MODULES
|
||||||
and create a dict[MODULE] = [sub module needed, ...]
|
and create a dict[MODULE] = [sub module needed, ...]
|
||||||
"""
|
"""
|
||||||
@ -59,23 +46,14 @@ def get_dict_genealogy():
|
|||||||
with open(path_file, "r") as f:
|
with open(path_file, "r") as f:
|
||||||
l_children = f.read().split()
|
l_children = f.read().split()
|
||||||
except IOError:
|
except IOError:
|
||||||
continue
|
pass
|
||||||
|
else:
|
||||||
try:
|
d_ref[o] = l_children
|
||||||
path_file = os.path.join(dir_, o, "Makefile")
|
|
||||||
with open(os.path.join(dir_, o, "Makefile"), "r") as f:
|
|
||||||
data = f.readlines()
|
|
||||||
l_depend = Dependency(get_list_from_makefile(data, "SRC="),
|
|
||||||
get_list_from_makefile(data, "OBJ="))
|
|
||||||
except IOError:
|
|
||||||
l_depend = []
|
|
||||||
|
|
||||||
d_ref[o] = Module_info(l_children, l_depend)
|
|
||||||
|
|
||||||
return d_ref
|
return d_ref
|
||||||
|
|
||||||
|
|
||||||
def him_and_all_children(d_ref, l_module):
|
def l_module_generalogy_rec(d_chidlren, l_module):
|
||||||
"""
|
"""
|
||||||
From a list of module return the module and all of the genealogy
|
From a list of module return the module and all of the genealogy
|
||||||
"""
|
"""
|
||||||
@ -85,7 +63,7 @@ def him_and_all_children(d_ref, l_module):
|
|||||||
if module not in l:
|
if module not in l:
|
||||||
l.append(module)
|
l.append(module)
|
||||||
try:
|
try:
|
||||||
l.extend(him_and_all_children(d_ref, d_ref[module].l_children))
|
l.extend(l_module_generalogy_rec(d_chidlren, d_chidlren[module]))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print >> sys.stderr, "`{0}` not submodule".format(module)
|
print >> sys.stderr, "`{0}` not submodule".format(module)
|
||||||
print >> sys.stderr, "Check the corresponding NEEDED_CHILDREN_MODULES"
|
print >> sys.stderr, "Check the corresponding NEEDED_CHILDREN_MODULES"
|
||||||
@ -94,85 +72,85 @@ def him_and_all_children(d_ref, l_module):
|
|||||||
return list(set(l))
|
return list(set(l))
|
||||||
|
|
||||||
|
|
||||||
def get_dict_genealogy_desc():
|
class ModuleHandler:
|
||||||
"""
|
|
||||||
Get a dic of all the genealogy desc (children and all_children)
|
|
||||||
"""
|
|
||||||
d_ref = get_dict_genealogy()
|
|
||||||
|
|
||||||
d = {}
|
dict_child = get_dict_child()
|
||||||
|
|
||||||
for module_name in d_ref:
|
@classproperty
|
||||||
d[module_name] = him_and_all_children(d_ref,
|
def l_module(self):
|
||||||
d_ref[module_name].l_children)
|
return self.dict_child.keys()
|
||||||
|
|
||||||
return d
|
@classproperty
|
||||||
|
def dict_parent(self):
|
||||||
|
|
||||||
def get_dict_parent():
|
|
||||||
"""
|
"""
|
||||||
Get a dic of the first parent
|
Get a dic of the first parent
|
||||||
"""
|
"""
|
||||||
d_ref = get_dict_genealogy()
|
d_child = self.dict_child
|
||||||
|
|
||||||
d = {}
|
d = {}
|
||||||
|
|
||||||
for module_name in d_ref:
|
for module_name in d_child:
|
||||||
d[module_name] = [i for i in d_ref.keys()
|
d[module_name] = [i for i in d_child.keys() if module_name in d_child[i]]
|
||||||
if module_name in d_ref[i].l_children]
|
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
@classproperty
|
||||||
|
def dict_descendant(self):
|
||||||
|
"""
|
||||||
|
Get a dic of all the genealogy desc (children and all_children)
|
||||||
|
"""
|
||||||
|
d = {}
|
||||||
|
|
||||||
def get_dict_module_boss():
|
d_child = self.dict_child
|
||||||
|
|
||||||
|
for module_name in d_child:
|
||||||
|
d[module_name] = l_module_generalogy_rec(d_child,
|
||||||
|
d_child[module_name])
|
||||||
|
|
||||||
|
return d
|
||||||
|
|
||||||
|
@classproperty
|
||||||
|
def dict_root(self):
|
||||||
"""
|
"""
|
||||||
Return a dict(module_name) = module_boss
|
Return a dict(module_name) = module_boss
|
||||||
Module boss is a module who have not parent (a edge) and have module_name
|
The top node in a tree.
|
||||||
in is genealogy
|
|
||||||
"""
|
"""
|
||||||
d_ref_asc = get_dict_parent()
|
d_asc = self.dict_parent
|
||||||
d_ref_desc = get_dict_genealogy_desc()
|
d_desc = self.dict_descendant
|
||||||
|
|
||||||
l_all_module = d_ref_asc.keys()
|
l_all_module = self.l_module
|
||||||
|
|
||||||
d_module_boss = {}
|
dict_root = {}
|
||||||
|
|
||||||
for module in l_all_module:
|
for module in l_all_module:
|
||||||
d_module_boss[module] = [
|
dict_root[module] = [ p for p in l_all_module if module in [p] + d_desc[p] and not d_asc[p]][0]
|
||||||
p for p in l_all_module
|
|
||||||
if module in [p] + d_ref_desc[p] and not d_ref_asc[p]
|
|
||||||
][0]
|
|
||||||
|
|
||||||
return d_module_boss
|
return dict_root
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def l_descendant_unique(cls, l_module):
|
||||||
|
d_desc = cls.dict_descendant
|
||||||
|
|
||||||
def module_genealogy(module_name):
|
d = {}
|
||||||
"""
|
for module in l_module:
|
||||||
Take a name of a NEEDED_CHILDREN_MODULES
|
for e in d_desc[module]:
|
||||||
and return a list of all the {sub, subsub, ...}children
|
d[e] = 1
|
||||||
"""
|
|
||||||
|
|
||||||
d_ref = get_dict_genealogy()
|
return d.keys()
|
||||||
return him_and_all_children(d_ref, d_ref[module_name].l_children)
|
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def l_reduce_tree(cls, l_module):
|
||||||
|
|
||||||
def file_dependency(module_name):
|
l_d_u = cls.l_descendant_unique(l_module)
|
||||||
|
l_module_reduce = []
|
||||||
|
for module in l_module:
|
||||||
|
if module not in l_d_u:
|
||||||
|
l_module_reduce.append(module)
|
||||||
|
|
||||||
d_ref = get_dict_genealogy()
|
return l_module_reduce
|
||||||
l_src, l_obj = d_ref[module_name].l_dependency
|
|
||||||
|
|
||||||
l_children_module = him_and_all_children(d_ref,
|
@classmethod
|
||||||
d_ref[module_name].l_children)
|
def create_png(cls, l_module):
|
||||||
for module in l_children_module:
|
|
||||||
l_src_dump, l_obj_dump = d_ref[module].l_dependency
|
|
||||||
l_src.extend("{0}/{1}".format(module, i) for i in l_src_dump)
|
|
||||||
l_obj.extend("IRPF90_temp/{0}/{1}".format(module, os.path.basename(i))
|
|
||||||
for i in l_obj_dump)
|
|
||||||
|
|
||||||
return Dependency(l_src, l_obj)
|
|
||||||
|
|
||||||
|
|
||||||
def create_png(l_module):
|
|
||||||
"""Create the png of the dependency tree for a l_module"""
|
"""Create the png of the dependency tree for a l_module"""
|
||||||
|
|
||||||
# Init
|
# Init
|
||||||
@ -188,18 +166,18 @@ def create_png(l_module):
|
|||||||
edge = pydot.Edge(module, children)
|
edge = pydot.Edge(module, children)
|
||||||
graph.add_edge(edge)
|
graph.add_edge(edge)
|
||||||
# Recurs
|
# Recurs
|
||||||
draw_module_edge(children, d_ref[children].l_children)
|
draw_module_edge(children, d_ref[children])
|
||||||
all_ready_done.append(module)
|
all_ready_done.append(module)
|
||||||
|
|
||||||
# Init
|
# Init
|
||||||
graph = pydot.Dot(graph_type='digraph')
|
graph = pydot.Dot(graph_type='digraph')
|
||||||
d_ref = get_dict_genealogy()
|
d_ref = cls.dict_child
|
||||||
|
|
||||||
# Create all the edge
|
# Create all the edge
|
||||||
for module in l_module:
|
for module in l_module:
|
||||||
node_a = pydot.Node(module, fontcolor="red")
|
node_a = pydot.Node(module, fontcolor="red")
|
||||||
graph.add_node(node_a)
|
graph.add_node(node_a)
|
||||||
draw_module_edge(module, d_ref[module].l_children)
|
draw_module_edge(module, d_ref[module])
|
||||||
|
|
||||||
# Save
|
# Save
|
||||||
path = '{0}.png'.format("tree_dependency")
|
path = '{0}.png'.format("tree_dependency")
|
||||||
@ -220,13 +198,8 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
path_file = os.path.basename(dir_)
|
path_file = os.path.basename(dir_)
|
||||||
|
|
||||||
if arguments['print_genealogy']:
|
if arguments['print_descendant']:
|
||||||
l_all_needed_molule = module_genealogy(path_file)
|
print " ".join(sorted(ModuleHandler.l_module))
|
||||||
print " ".join(sorted(l_all_needed_molule))
|
|
||||||
|
|
||||||
if arguments["create_png"]:
|
if arguments["create_png"]:
|
||||||
create_png([path_file])
|
ModuleHandler.create_png([path_file])
|
||||||
|
|
||||||
if arguments["head_module"]:
|
|
||||||
for module, boss in get_dict_module_boss().iteritems():
|
|
||||||
print module, boss
|
|
||||||
|
82
scripts/module/qp_create_module.py
Executable file
82
scripts/module/qp_create_module.py
Executable file
@ -0,0 +1,82 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
Usage: qp_create_module.py list
|
||||||
|
qp_create_module.py create -n <name> [<children_module>...]
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
try:
|
||||||
|
from docopt import docopt
|
||||||
|
from module_handler import ModuleHandler
|
||||||
|
from update_README import Doc_key, Needed_key
|
||||||
|
except ImportError:
|
||||||
|
print "source .quantum_package.rc"
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
def save_new_module(path, l_child):
|
||||||
|
|
||||||
|
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
||||||
|
# N E E D E D _ C H I L D R E N _ M O D U L E S #
|
||||||
|
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.makedirs(path)
|
||||||
|
except OSError:
|
||||||
|
print "The module ({0}) already exist...".format(path)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
with open(os.path.join(path, "NEEDED_CHILDREN_MODULES"), "w") as f:
|
||||||
|
f.write(" ".join(l_child))
|
||||||
|
f.write("\n")
|
||||||
|
|
||||||
|
# ~#~#~#~#~#~#~ #
|
||||||
|
# R E A D _ M E #
|
||||||
|
# ~#~#~#~#~#~#~ #
|
||||||
|
|
||||||
|
module_name = os.path.basename(path)
|
||||||
|
|
||||||
|
header = "{0}\n{1}\n{0}\n".format("=" * len(module_name), module_name)
|
||||||
|
|
||||||
|
with open(os.path.join(path, "README.rst"), "w") as f:
|
||||||
|
f.write(header + "\n")
|
||||||
|
f.write(Doc_key + "\n")
|
||||||
|
f.write(Needed_key + "\n")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
arguments = docopt(__doc__)
|
||||||
|
|
||||||
|
if arguments["list"]:
|
||||||
|
for module in ModuleHandler.l_module:
|
||||||
|
print module
|
||||||
|
|
||||||
|
elif arguments["create"]:
|
||||||
|
l_children = arguments["<children_module>"]
|
||||||
|
|
||||||
|
qpackage_root = os.environ['QPACKAGE_ROOT']
|
||||||
|
path = os.path.join(qpackage_root, "src", arguments["<name>"])
|
||||||
|
|
||||||
|
print "You will create the module:"
|
||||||
|
print path
|
||||||
|
|
||||||
|
for children in l_children:
|
||||||
|
if children not in ModuleHandler.dict_descendant:
|
||||||
|
print "This module ({0}) is not a valide module.".format(children)
|
||||||
|
print "Run `list` flag for the list of module avalaible"
|
||||||
|
print "Aborting..."
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
print "You ask for this submodule:"
|
||||||
|
print l_children
|
||||||
|
|
||||||
|
print "You can use all the routine in this module"
|
||||||
|
print l_children + ModuleHandler.l_descendant_unique(l_children)
|
||||||
|
|
||||||
|
print "This can be reduce to:"
|
||||||
|
l_child_reduce = ModuleHandler.l_reduce_tree(l_children)
|
||||||
|
print l_child_reduce
|
||||||
|
save_new_module(path, l_child_reduce)
|
@ -1,140 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# usage:
|
|
||||||
# create_module.sh MOs AOs Electrons
|
|
||||||
# Prepares all the files for the creation of a new module.
|
|
||||||
# The first argument is the name of the module
|
|
||||||
# All remaining aruments are dependencies.
|
|
||||||
# Thu Apr 3 01:44:58 CEST 2014
|
|
||||||
|
|
||||||
if [[ -z ${QPACKAGE_ROOT} ]]
|
|
||||||
then
|
|
||||||
print "The QPACKAGE_ROOT environment variable is not set."
|
|
||||||
print "Please reload the quantum_package.rc file."
|
|
||||||
exit -1
|
|
||||||
fi
|
|
||||||
source ${QPACKAGE_ROOT}/scripts/qp_include.sh
|
|
||||||
|
|
||||||
check_current_dir_is_src
|
|
||||||
|
|
||||||
DEBUG=0
|
|
||||||
|
|
||||||
# If DEBUG=1, the print debug info.
|
|
||||||
function debug()
|
|
||||||
{
|
|
||||||
if [[ $DEBUG -eq 1 ]]
|
|
||||||
then
|
|
||||||
function debug()
|
|
||||||
{
|
|
||||||
echo "$@"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
function debug()
|
|
||||||
{
|
|
||||||
:
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
debug $@
|
|
||||||
}
|
|
||||||
|
|
||||||
function fail()
|
|
||||||
{
|
|
||||||
echo "Error: $@"
|
|
||||||
cd "${QPACKAGE_ROOT}/src"
|
|
||||||
rm -rf -- "${MODULE}"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MODULE=$1
|
|
||||||
|
|
||||||
# Check command line
|
|
||||||
if [[ -z $MODULE ]]
|
|
||||||
then
|
|
||||||
echo "usage: $(basename $0) <NewModuleName>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
shift
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if module already exists
|
|
||||||
if [ -d ${MODULE} ]
|
|
||||||
then
|
|
||||||
echo "Error: Module $MODULE already exists"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
debug "Module does not already exist: OK"
|
|
||||||
|
|
||||||
|
|
||||||
# Set up dependencies
|
|
||||||
ALL_MODULES="$(cat NEEDED_MODULES)"
|
|
||||||
echo "Select which modules you are sure you will need: (press q to quit)"
|
|
||||||
NEEDED_MODULES=""
|
|
||||||
select M in ${ALL_MODULES}
|
|
||||||
do
|
|
||||||
if [[ -z $M ]]
|
|
||||||
then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
NEEDED_MODULES+=" $M"
|
|
||||||
echo "$NEEDED_MODULES"
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create module directory and go into it
|
|
||||||
mkdir "${QPACKAGE_ROOT}/src/${MODULE}"
|
|
||||||
if [[ $? != 0 ]]
|
|
||||||
then
|
|
||||||
echo "Error: Unable to create module directory."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d "${QPACKAGE_ROOT}/src/${MODULE}" ]]
|
|
||||||
then
|
|
||||||
echo "Something strange happened: the"
|
|
||||||
echo "${QPACKAGE_ROOT}/src/${MODULE}"
|
|
||||||
echo "directory was not created."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "${QPACKAGE_ROOT}/src/${MODULE}"
|
|
||||||
if [[ "${PWD}" != "${QPACKAGE_ROOT}/src/${MODULE}" ]]
|
|
||||||
then
|
|
||||||
echo "Something strange happened: we should be in"
|
|
||||||
echo "${QPACKAGE_ROOT}/src/${MODULE}"
|
|
||||||
echo "but we are in"
|
|
||||||
echo "${PWD}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
debug "Module directory is created."
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create the Makefile
|
|
||||||
"${QPACKAGE_ROOT}/scripts/module/create_Makefile.sh" || fail "Unable to create Makefile"
|
|
||||||
if [[ ! -f Makefile ]]
|
|
||||||
then
|
|
||||||
fail "Makefile was not created"
|
|
||||||
fi
|
|
||||||
debug "Makefile created"
|
|
||||||
|
|
||||||
# Create the NEEDED_MODULES file
|
|
||||||
echo "$NEEDED_MODULES" > NEEDED_CHILDREN_MODULES
|
|
||||||
debug "NEEDED_MODULES created"
|
|
||||||
|
|
||||||
# Create rst templates
|
|
||||||
"${QPACKAGE_ROOT}/scripts/module/create_rst_templates.sh" || fail "Unable to create rst templates"
|
|
||||||
|
|
||||||
|
|
||||||
# Update module list in main NEEDED_MODULES
|
|
||||||
ALL_MODULES+=" ${MODULE}"
|
|
||||||
echo "${ALL_MODULES}" > "${QPACKAGE_ROOT}/src/NEEDED_MODULES"
|
|
||||||
debug "Updated NEEDED_MODULES"
|
|
||||||
|
|
||||||
|
|
@ -23,19 +23,15 @@ header = """
|
|||||||
|
|
||||||
def fetch_splitted_data():
|
def fetch_splitted_data():
|
||||||
"""Read the README.rst file and split it in strings:
|
"""Read the README.rst file and split it in strings:
|
||||||
* The description
|
|
||||||
* The assumptions
|
|
||||||
* The documentation
|
* The documentation
|
||||||
* The needed modules
|
* The needed modules
|
||||||
The result is given as a list of strings
|
The result is given as a list of strings
|
||||||
"""
|
"""
|
||||||
|
|
||||||
file = open(README, 'r')
|
with open(README, 'r') as f:
|
||||||
data = file.read()
|
data = f.read()
|
||||||
file.close()
|
|
||||||
|
|
||||||
# Place sentinels
|
# Place sentinels
|
||||||
data = data.replace(Assum_key, Sentinel + Assum_key)
|
|
||||||
data = data.replace(Doc_key, Sentinel + Doc_key)
|
data = data.replace(Doc_key, Sentinel + Doc_key)
|
||||||
data = data.replace(Needed_key, Sentinel + Needed_key)
|
data = data.replace(Needed_key, Sentinel + Needed_key)
|
||||||
|
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
from functools import wraps
|
|
||||||
|
|
||||||
def cache(func):
|
|
||||||
"""
|
|
||||||
A decorator for lazy evaluation off true function
|
|
||||||
"""
|
|
||||||
saved = {}
|
|
||||||
|
|
||||||
@wraps(func)
|
|
||||||
def newfunc(*args):
|
|
||||||
if args in saved:
|
|
||||||
return saved[args]
|
|
||||||
|
|
||||||
result = func(*args)
|
|
||||||
saved[args] = result
|
|
||||||
return result
|
|
||||||
return newfunc
|
|
@ -3,13 +3,13 @@
|
|||||||
implicit none
|
implicit none
|
||||||
integer :: n_pt_sup
|
integer :: n_pt_sup
|
||||||
integer :: prim_power_l_max
|
integer :: prim_power_l_max
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
prim_power_l_max = maxval(ao_power)
|
prim_power_l_max = maxval(ao_power)
|
||||||
n_pt_max_integrals = 24 * prim_power_l_max + 4
|
n_pt_max_integrals = 24 * prim_power_l_max + 4
|
||||||
n_pt_max_i_x = 8 * prim_power_l_max
|
n_pt_max_i_x = 8 * prim_power_l_max
|
||||||
ASSERT (n_pt_max_i_x-1 <= max_dim)
|
ASSERT (n_pt_max_i_x-1 <= max_dim)
|
||||||
if (n_pt_max_i_x-1 > max_dim) then
|
if (n_pt_max_i_x-1 > max_dim) then
|
||||||
print *, 'Increase max_dim in Utils/constants.F to ', n_pt_max_i_x-1
|
print *, 'Increase max_dim in Utils/constants.include.F to ', n_pt_max_i_x-1
|
||||||
stop 1
|
stop 1
|
||||||
endif
|
endif
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
@ -8,7 +8,7 @@ double precision function aux_basis_four_overlap(i,j,k,l)
|
|||||||
double precision :: I_center(3),J_center(3),K_center(3),L_center(3)
|
double precision :: I_center(3),J_center(3),K_center(3),L_center(3)
|
||||||
integer :: num_i,num_j,num_k,num_l,dim1,I_power(3),J_power(3),K_power(3),L_power(3)
|
integer :: num_i,num_j,num_k,num_l,dim1,I_power(3),J_power(3),K_power(3),L_power(3)
|
||||||
double precision :: overlap_x,overlap_y,overlap_z, overlap
|
double precision :: overlap_x,overlap_y,overlap_z, overlap
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp
|
double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp
|
||||||
double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq
|
double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq
|
||||||
integer :: iorder_p(3), iorder_q(3)
|
integer :: iorder_p(3), iorder_q(3)
|
||||||
|
@ -9,7 +9,7 @@ double precision function ao_bielec_integral(i,j,k,l)
|
|||||||
double precision :: I_center(3),J_center(3),K_center(3),L_center(3)
|
double precision :: I_center(3),J_center(3),K_center(3),L_center(3)
|
||||||
integer :: num_i,num_j,num_k,num_l,dim1,I_power(3),J_power(3),K_power(3),L_power(3)
|
integer :: num_i,num_j,num_k,num_l,dim1,I_power(3),J_power(3),K_power(3),L_power(3)
|
||||||
double precision :: integral
|
double precision :: integral
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp
|
double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp
|
||||||
double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq
|
double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq
|
||||||
integer :: iorder_p(3), iorder_q(3)
|
integer :: iorder_p(3), iorder_q(3)
|
||||||
@ -115,7 +115,7 @@ double precision function ao_bielec_integral_schwartz_accel(i,j,k,l)
|
|||||||
double precision :: I_center(3),J_center(3),K_center(3),L_center(3)
|
double precision :: I_center(3),J_center(3),K_center(3),L_center(3)
|
||||||
integer :: num_i,num_j,num_k,num_l,dim1,I_power(3),J_power(3),K_power(3),L_power(3)
|
integer :: num_i,num_j,num_k,num_l,dim1,I_power(3),J_power(3),K_power(3),L_power(3)
|
||||||
double precision :: integral
|
double precision :: integral
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp
|
double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp
|
||||||
double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq
|
double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq
|
||||||
integer :: iorder_p(3), iorder_q(3)
|
integer :: iorder_p(3), iorder_q(3)
|
||||||
@ -519,7 +519,7 @@ double precision function general_primitive_integral(dim, &
|
|||||||
! Computes the integral <pq|rs> where p,q,r,s are Gaussian primitives
|
! Computes the integral <pq|rs> where p,q,r,s are Gaussian primitives
|
||||||
END_DOC
|
END_DOC
|
||||||
integer,intent(in) :: dim
|
integer,intent(in) :: dim
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision, intent(in) :: P_new(0:max_dim,3),P_center(3),fact_p,p,p_inv
|
double precision, intent(in) :: P_new(0:max_dim,3),P_center(3),fact_p,p,p_inv
|
||||||
double precision, intent(in) :: Q_new(0:max_dim,3),Q_center(3),fact_q,q,q_inv
|
double precision, intent(in) :: Q_new(0:max_dim,3),Q_center(3),fact_q,q,q_inv
|
||||||
integer, intent(in) :: iorder_p(3)
|
integer, intent(in) :: iorder_p(3)
|
||||||
@ -665,7 +665,7 @@ double precision function ERI(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,
|
|||||||
integer :: n_pt_sup
|
integer :: n_pt_sup
|
||||||
double precision :: p,q,denom,coeff
|
double precision :: p,q,denom,coeff
|
||||||
double precision :: I_f
|
double precision :: I_f
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
if(iand(a_x+b_x+c_x+d_x,1).eq.1.or.iand(a_y+b_y+c_y+d_y,1).eq.1.or.iand(a_z+b_z+c_z+d_z,1).eq.1)then
|
if(iand(a_x+b_x+c_x+d_x,1).eq.1.or.iand(a_y+b_y+c_y+d_y,1).eq.1.or.iand(a_z+b_z+c_z+d_z,1).eq.1)then
|
||||||
ERI = 0.d0
|
ERI = 0.d0
|
||||||
return
|
return
|
||||||
@ -859,7 +859,7 @@ subroutine give_polynom_mult_center_x(P_center,Q_center,a_x,d_x,p,q,n_pt_in,pq_i
|
|||||||
integer, intent(in) :: a_x,d_x
|
integer, intent(in) :: a_x,d_x
|
||||||
double precision, intent(in) :: P_center, Q_center
|
double precision, intent(in) :: P_center, Q_center
|
||||||
double precision, intent(in) :: p,q,pq_inv,p10_1,p01_1,p10_2,p01_2,pq_inv_2
|
double precision, intent(in) :: p,q,pq_inv,p10_1,p01_1,p10_2,p01_2,pq_inv_2
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision,intent(out) :: d(0:max_dim)
|
double precision,intent(out) :: d(0:max_dim)
|
||||||
double precision :: accu
|
double precision :: accu
|
||||||
accu = 0.d0
|
accu = 0.d0
|
||||||
@ -916,7 +916,7 @@ subroutine I_x1_pol_mult(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in)
|
|||||||
! recursive function involved in the bielectronic integral
|
! recursive function involved in the bielectronic integral
|
||||||
END_DOC
|
END_DOC
|
||||||
integer , intent(in) :: n_pt_in
|
integer , intent(in) :: n_pt_in
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision,intent(inout) :: d(0:max_dim)
|
double precision,intent(inout) :: d(0:max_dim)
|
||||||
integer,intent(inout) :: nd
|
integer,intent(inout) :: nd
|
||||||
integer, intent(in) :: a,c
|
integer, intent(in) :: a,c
|
||||||
@ -950,7 +950,7 @@ recursive subroutine I_x1_pol_mult_recurs(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt
|
|||||||
! recursive function involved in the bielectronic integral
|
! recursive function involved in the bielectronic integral
|
||||||
END_DOC
|
END_DOC
|
||||||
integer , intent(in) :: n_pt_in
|
integer , intent(in) :: n_pt_in
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision,intent(inout) :: d(0:max_dim)
|
double precision,intent(inout) :: d(0:max_dim)
|
||||||
integer,intent(inout) :: nd
|
integer,intent(inout) :: nd
|
||||||
integer, intent(in) :: a,c
|
integer, intent(in) :: a,c
|
||||||
@ -1036,7 +1036,7 @@ recursive subroutine I_x1_pol_mult_a1(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in)
|
|||||||
! recursive function involved in the bielectronic integral
|
! recursive function involved in the bielectronic integral
|
||||||
END_DOC
|
END_DOC
|
||||||
integer , intent(in) :: n_pt_in
|
integer , intent(in) :: n_pt_in
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision,intent(inout) :: d(0:max_dim)
|
double precision,intent(inout) :: d(0:max_dim)
|
||||||
integer,intent(inout) :: nd
|
integer,intent(inout) :: nd
|
||||||
integer, intent(in) :: c
|
integer, intent(in) :: c
|
||||||
@ -1090,7 +1090,7 @@ recursive subroutine I_x1_pol_mult_a2(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in)
|
|||||||
! recursive function involved in the bielectronic integral
|
! recursive function involved in the bielectronic integral
|
||||||
END_DOC
|
END_DOC
|
||||||
integer , intent(in) :: n_pt_in
|
integer , intent(in) :: n_pt_in
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision,intent(inout) :: d(0:max_dim)
|
double precision,intent(inout) :: d(0:max_dim)
|
||||||
integer,intent(inout) :: nd
|
integer,intent(inout) :: nd
|
||||||
integer, intent(in) :: c
|
integer, intent(in) :: c
|
||||||
@ -1152,7 +1152,7 @@ recursive subroutine I_x2_pol_mult(c,B_10,B_01,B_00,C_00,D_00,d,nd,dim)
|
|||||||
! recursive function involved in the bielectronic integral
|
! recursive function involved in the bielectronic integral
|
||||||
END_DOC
|
END_DOC
|
||||||
integer , intent(in) :: dim
|
integer , intent(in) :: dim
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision :: d(0:max_dim)
|
double precision :: d(0:max_dim)
|
||||||
integer,intent(inout) :: nd
|
integer,intent(inout) :: nd
|
||||||
integer, intent(in) :: c
|
integer, intent(in) :: c
|
||||||
|
@ -148,7 +148,7 @@ double precision :: P_center(3)
|
|||||||
double precision :: d(0:n_pt_in),pouet,coeff,rho,dist,const,pouet_2,p,p_inv,factor
|
double precision :: d(0:n_pt_in),pouet,coeff,rho,dist,const,pouet_2,p,p_inv,factor
|
||||||
double precision :: I_n_special_exact,integrate_bourrin,I_n_bibi
|
double precision :: I_n_special_exact,integrate_bourrin,I_n_bibi
|
||||||
double precision :: V_e_n,const_factor,dist_integral,tmp
|
double precision :: V_e_n,const_factor,dist_integral,tmp
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
if ( (A_center(1)/=B_center(1)).or. &
|
if ( (A_center(1)/=B_center(1)).or. &
|
||||||
(A_center(2)/=B_center(2)).or. &
|
(A_center(2)/=B_center(2)).or. &
|
||||||
(A_center(3)/=B_center(3)).or. &
|
(A_center(3)/=B_center(3)).or. &
|
||||||
@ -351,7 +351,7 @@ recursive subroutine I_x1_pol_mult_mono_elec(a,c,R1x,R1xp,R2x,d,nd,n_pt_in)
|
|||||||
integer,intent(inout) :: nd
|
integer,intent(inout) :: nd
|
||||||
integer, intent(in):: a,c
|
integer, intent(in):: a,c
|
||||||
double precision, intent(in) :: R1x(0:2),R1xp(0:2),R2x(0:2)
|
double precision, intent(in) :: R1x(0:2),R1xp(0:2),R2x(0:2)
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision :: X(0:max_dim)
|
double precision :: X(0:max_dim)
|
||||||
double precision :: Y(0:max_dim)
|
double precision :: Y(0:max_dim)
|
||||||
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: X, Y
|
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: X, Y
|
||||||
@ -417,7 +417,7 @@ end
|
|||||||
recursive subroutine I_x2_pol_mult_mono_elec(c,R1x,R1xp,R2x,d,nd,dim)
|
recursive subroutine I_x2_pol_mult_mono_elec(c,R1x,R1xp,R2x,d,nd,dim)
|
||||||
implicit none
|
implicit none
|
||||||
integer , intent(in) :: dim
|
integer , intent(in) :: dim
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
double precision :: d(0:max_dim)
|
double precision :: d(0:max_dim)
|
||||||
integer,intent(inout) :: nd
|
integer,intent(inout) :: nd
|
||||||
integer, intent(in):: c
|
integer, intent(in):: c
|
||||||
@ -492,7 +492,7 @@ implicit none
|
|||||||
double precision :: alpha
|
double precision :: alpha
|
||||||
integer :: n
|
integer :: n
|
||||||
double precision :: dble_fact
|
double precision :: dble_fact
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
|
|
||||||
!if(iand(n,1).eq.1)then
|
!if(iand(n,1).eq.1)then
|
||||||
! int_gaus_pol= 0.d0
|
! int_gaus_pol= 0.d0
|
||||||
@ -521,7 +521,7 @@ double precision function V_r(n,alpha)
|
|||||||
implicit none
|
implicit none
|
||||||
double precision :: alpha, fact
|
double precision :: alpha, fact
|
||||||
integer :: n
|
integer :: n
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
if(iand(n,1).eq.1)then
|
if(iand(n,1).eq.1)then
|
||||||
V_r = 0.5d0 * fact(ishft(n,-1)) / (alpha ** (ishft(n,-1) + 1))
|
V_r = 0.5d0 * fact(ishft(n,-1)) / (alpha ** (ishft(n,-1) + 1))
|
||||||
else
|
else
|
||||||
@ -549,7 +549,7 @@ implicit none
|
|||||||
!! integral on "theta" with boundaries ( 0 ; pi) of [ cos(theta) **n sin(theta) **m ]
|
!! integral on "theta" with boundaries ( 0 ; pi) of [ cos(theta) **n sin(theta) **m ]
|
||||||
integer :: n,m,i
|
integer :: n,m,i
|
||||||
double precision :: Wallis, prod
|
double precision :: Wallis, prod
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
V_theta = 0.d0
|
V_theta = 0.d0
|
||||||
prod = 1.d0
|
prod = 1.d0
|
||||||
do i = 0,ishft(n,-1)-1
|
do i = 0,ishft(n,-1)-1
|
||||||
@ -565,7 +565,7 @@ double precision function Wallis(n)
|
|||||||
implicit none
|
implicit none
|
||||||
double precision :: fact
|
double precision :: fact
|
||||||
integer :: n,p
|
integer :: n,p
|
||||||
include 'Utils/constants.F'
|
include 'Utils/constants.include.F'
|
||||||
if(iand(n,1).eq.0)then
|
if(iand(n,1).eq.0)then
|
||||||
Wallis = fact(ishft(n,-1))
|
Wallis = fact(ishft(n,-1))
|
||||||
Wallis = pi * fact(n) / (dble(ibset(0_8,n)) * (Wallis+Wallis)*Wallis)
|
Wallis = pi * fact(n) / (dble(ibset(0_8,n)) * (Wallis+Wallis)*Wallis)
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
integer, parameter :: max_dim = 255
|
|
||||||
integer, parameter :: SIMD_vector = 32
|
|
||||||
|
|
||||||
double precision, parameter :: pi = dacos(-1.d0)
|
|
||||||
double precision, parameter :: sqpi = dsqrt(dacos(-1.d0))
|
|
||||||
double precision, parameter :: pi_5_2 = 34.9868366552d0
|
|
||||||
double precision, parameter :: dfour_pi = 4.d0*dacos(-1.d0)
|
|
||||||
double precision, parameter :: dtwo_pi = 2.d0*dacos(-1.d0)
|
|
||||||
double precision, parameter :: inv_sq_pi = 1.d0/dsqrt(dacos(-1.d0))
|
|
||||||
double precision, parameter :: inv_sq_pi_2 = 0.5d0/dsqrt(dacos(-1.d0))
|
|
@ -6,7 +6,7 @@ subroutine give_explicit_poly_and_gaussian_x(P_new,P_center,p,fact_k,iorder,alph
|
|||||||
! fact_k (x-x_P)^iorder(1) (y-y_P)^iorder(2) (z-z_P)^iorder(3) exp(-p(r-P)^2)
|
! fact_k (x-x_P)^iorder(1) (y-y_P)^iorder(2) (z-z_P)^iorder(3) exp(-p(r-P)^2)
|
||||||
END_DOC
|
END_DOC
|
||||||
implicit none
|
implicit none
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
integer, intent(in) :: dim
|
integer, intent(in) :: dim
|
||||||
integer, intent(in) :: a,b ! powers : (x-xa)**a_x = (x-A(1))**a(1)
|
integer, intent(in) :: a,b ! powers : (x-xa)**a_x = (x-A(1))**a(1)
|
||||||
double precision, intent(in) :: alpha, beta ! exponents
|
double precision, intent(in) :: alpha, beta ! exponents
|
||||||
@ -53,7 +53,7 @@ subroutine give_explicit_poly_and_gaussian(P_new,P_center,p,fact_k,iorder,alpha,
|
|||||||
! * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 )
|
! * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 )
|
||||||
END_DOC
|
END_DOC
|
||||||
implicit none
|
implicit none
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
integer, intent(in) :: dim
|
integer, intent(in) :: dim
|
||||||
integer, intent(in) :: a(3),b(3) ! powers : (x-xa)**a_x = (x-A(1))**a(1)
|
integer, intent(in) :: a(3),b(3) ! powers : (x-xa)**a_x = (x-A(1))**a(1)
|
||||||
double precision, intent(in) :: alpha, beta ! exponents
|
double precision, intent(in) :: alpha, beta ! exponents
|
||||||
@ -131,7 +131,7 @@ subroutine give_explicit_poly_and_gaussian_double(P_new,P_center,p,fact_k,iorder
|
|||||||
! * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 )
|
! * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 )
|
||||||
END_DOC
|
END_DOC
|
||||||
implicit none
|
implicit none
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
integer, intent(in) :: dim
|
integer, intent(in) :: dim
|
||||||
integer, intent(in) :: a(3),b(3) ! powers : (x-xa)**a_x = (x-A(1))**a(1)
|
integer, intent(in) :: a(3),b(3) ! powers : (x-xa)**a_x = (x-A(1))**a(1)
|
||||||
double precision, intent(in) :: alpha, beta, gama ! exponents
|
double precision, intent(in) :: alpha, beta, gama ! exponents
|
||||||
@ -415,7 +415,7 @@ double precision function F_integral(n,p)
|
|||||||
double precision :: p
|
double precision :: p
|
||||||
integer :: i,j
|
integer :: i,j
|
||||||
double precision :: accu,sqrt_p,fact_ratio,tmp,fact
|
double precision :: accu,sqrt_p,fact_ratio,tmp,fact
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
if(n < 0)then
|
if(n < 0)then
|
||||||
F_integral = 0.d0
|
F_integral = 0.d0
|
||||||
endif
|
endif
|
||||||
@ -441,7 +441,7 @@ double precision function rint(n,rho)
|
|||||||
! \int_0^1 dx \exp(-p x^2) x^n
|
! \int_0^1 dx \exp(-p x^2) x^n
|
||||||
!
|
!
|
||||||
END_DOC
|
END_DOC
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
double precision :: rho,u,rint1,v,val0,rint_large_n,u_inv
|
double precision :: rho,u,rint1,v,val0,rint_large_n,u_inv
|
||||||
integer :: n,k
|
integer :: n,k
|
||||||
double precision :: two_rho_inv
|
double precision :: two_rho_inv
|
||||||
@ -486,7 +486,7 @@ double precision function rint_sum(n_pt_out,rho,d1)
|
|||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Needed for the calculation of two-electron integrals.
|
! Needed for the calculation of two-electron integrals.
|
||||||
END_DOC
|
END_DOC
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
integer, intent(in) :: n_pt_out
|
integer, intent(in) :: n_pt_out
|
||||||
double precision, intent(in) :: rho,d1(0:n_pt_out)
|
double precision, intent(in) :: rho,d1(0:n_pt_out)
|
||||||
double precision :: u,rint1,v,val0,rint_large_n,u_inv
|
double precision :: u,rint1,v,val0,rint_large_n,u_inv
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
double precision function rinteg(n,u)
|
double precision function rinteg(n,u)
|
||||||
implicit double precision(a-h,o-z)
|
implicit double precision(a-h,o-z)
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
! pi=dacos(-1.d0)
|
! pi=dacos(-1.d0)
|
||||||
ichange=1
|
ichange=1
|
||||||
factor=1.d0
|
factor=1.d0
|
||||||
|
@ -6,7 +6,7 @@ double precision function overlap_gaussian_x(A_center,B_center,alpha,beta,power_
|
|||||||
! \sum_{-infty}^{+infty} (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2) dx
|
! \sum_{-infty}^{+infty} (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2) dx
|
||||||
!
|
!
|
||||||
END_DOC
|
END_DOC
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
integer,intent(in) :: dim ! dimension maximum for the arrays representing the polynomials
|
integer,intent(in) :: dim ! dimension maximum for the arrays representing the polynomials
|
||||||
double precision,intent(in) :: A_center,B_center ! center of the x1 functions
|
double precision,intent(in) :: A_center,B_center ! center of the x1 functions
|
||||||
integer,intent(in) :: power_A, power_B ! power of the x1 functions
|
integer,intent(in) :: power_A, power_B ! power of the x1 functions
|
||||||
@ -34,7 +34,7 @@ end
|
|||||||
|
|
||||||
subroutine overlap_A_B_C(dim,alpha,beta,gama,a,b,A_center,B_center,Nucl_center,overlap)
|
subroutine overlap_A_B_C(dim,alpha,beta,gama,a,b,A_center,B_center,Nucl_center,overlap)
|
||||||
implicit none
|
implicit none
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
integer, intent(in) :: dim
|
integer, intent(in) :: dim
|
||||||
integer, intent(in) :: a(3),b(3) ! powers : (x-xa)**a_x = (x-A(1))**a(1)
|
integer, intent(in) :: a(3),b(3) ! powers : (x-xa)**a_x = (x-A(1))**a(1)
|
||||||
double precision, intent(in) :: alpha, beta, gama ! exponents
|
double precision, intent(in) :: alpha, beta, gama ! exponents
|
||||||
@ -120,7 +120,7 @@ subroutine overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,&
|
|||||||
! S = S_x S_y S_z
|
! S = S_x S_y S_z
|
||||||
!
|
!
|
||||||
END_DOC
|
END_DOC
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
integer,intent(in) :: dim ! dimension maximum for the arrays representing the polynomials
|
integer,intent(in) :: dim ! dimension maximum for the arrays representing the polynomials
|
||||||
double precision,intent(in) :: A_center(3),B_center(3) ! center of the x1 functions
|
double precision,intent(in) :: A_center(3),B_center(3) ! center of the x1 functions
|
||||||
double precision, intent(in) :: alpha,beta
|
double precision, intent(in) :: alpha,beta
|
||||||
|
@ -51,7 +51,7 @@ integer function align_double(n)
|
|||||||
! Compute 1st dimension such that it is aligned for vectorization.
|
! Compute 1st dimension such that it is aligned for vectorization.
|
||||||
END_DOC
|
END_DOC
|
||||||
integer :: n
|
integer :: n
|
||||||
include 'constants.F'
|
include 'constants.include.F'
|
||||||
if (mod(n,SIMD_vector/4) /= 0) then
|
if (mod(n,SIMD_vector/4) /= 0) then
|
||||||
align_double= n + SIMD_vector/4 - mod(n,SIMD_vector/4)
|
align_double= n + SIMD_vector/4 - mod(n,SIMD_vector/4)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user