10
0
mirror of https://github.com/LCPQ/quantum_package synced 2025-03-13 20:32:26 +01:00

Merge pull request #68 from TApplencourt/master

Welcome Ninja
This commit is contained in:
Anthony Scemama 2015-06-05 14:15:03 +02:00
commit dae68ede97
296 changed files with 5815 additions and 5048 deletions

12
.gitignore vendored
View File

@ -1,11 +1,15 @@
quantum_package.rc
EZFIO
irpf90
EMSL_Basis
EZFIO/
irpf90/
EMSL_Basis/
ninja/
bin/
*.log
quantum_package_static.tar.gz
resultsFile
opam_installer.sh
*.mod
*.p
*.p
build.ninja
.ninja_log
.ninja_deps

View File

@ -5,13 +5,14 @@ python:
- "2.6"
before_script:
- sudo apt-get update
- sudo apt-get install gfortran liblapack-dev
- sudo apt-get update -q
- sudo apt-get install gfortran liblapack-dev gcc
- sudo apt-get install graphviz
script:
- ./setup_environment.sh --robot
- source ./quantum_package.rc
- cp ./src/Makefile.config.gfortran ./src/Makefile.config
- make build
- ./tests/unit_test/unit_test.py
- qp_create_ninja.py --production ./config/gfortran_example.cfg
- ninja
- cd ocaml ; make ; cd -
- cd testing_no_regression ; ./unit_test.py

31
COMPILE_RUN.md Normal file
View File

@ -0,0 +1,31 @@
# Compile
We need to create the file who contain all the tree dependencies for the binaries. It's not a MakeFile, but a Ninja file. (So don't type `make` is hopeless, type `ninja` instead)
The script to create the dependencies file (aka `build.ninja`) is `create_ninja_build.py`.
## What utilization of the code will you do?
* If you only want the binaries (for production workflow) use the flag `--production` in when calling this script. It's quicker
* Else if you are a developer and you want to be able to only compile one specific module use: `--development`
## Compilation Flag
You need to specify all the flag useful for the compilation: like the optimization one, the mkl one .``$QPACKAGE_ROOT/config`` contains ``ifort.cfg`` and ``gfortran.cfg`` files which have the compiler flags that will be used to compile the code. You can edit these files to modify the compiling option. Put the file path when calling `create_ninja_build.py`
## Example to create the Ninja file
`create_ninja_build.py --production $QPACKAGE_ROOT/config/ifort.cfg`
# WARNING
For now reload this command if you add a `IRP.f90` or `EZFIO.cfg` file or modify the `NEED_CHILDREN_MODULE`!
## Compile
Just type `ninja` if you are in `$QPACKAGE_ROOT` (or `ninja -f $QPACKAGE_ROOT/build.ninja` elsewhere). The compilation will take approximately 3 min.
If you have set the `--developement` flag in a specific module you can go in the corresponding IRPF90_temp and run `ninja` to only make the module and submodule binaries. (You can use the `-f` option too)
Now go in `$QPACKAGE_ROOT/ocaml` and type `make`

View File

@ -1,49 +0,0 @@
BLUE=
BLACK=(B
.PHONY: doc src ocaml build binary
default:
@echo -----------------------------------------------
@echo To set up the environment, run
@echo ./setup_environment.sh
@echo
@echo To compile everything, run
@echo make build
@echo
@echo To compile a binary distribution for export, run
@echo make binary
@echo -----------------------------------------------
ifndef QPACKAGE_ROOT
build:
@echo -------------------- Error --------------------
@echo QPACKAGE_ROOT undefined.
@echo Run
@echo ./setup_environment.sh
@echo or
@echo source quantum_package.rc
@echo -----------------------------------------------
else
build:
$(MAKE) -C src
$(MAKE) -C ocaml
endif
binary:
$(QPACKAGE_ROOT)/scripts/make_binary.sh
doc:
$(MAKE) -C doc
src:
$(MAKE) -C src
ocaml:
$(MAKE) ocaml/Qptypes.ml
veryclean:
rm -rf EZFIO
rm -rf resultsFile
$(MAKE) -C src veryclean

View File

@ -0,0 +1,63 @@
# Common flags
##############
#
# -ffree-line-length-none : Needed for IRPF90 which produces long lines
# -lblas -llapack : Link with libblas and liblapack libraries provided by the system
# -I . : Include the curent directory (Mandatory)
#
# --ninja : Allow the utilisation of ninja. (Mandatory)
# --align=32 : Align all provided arrays on a 32-byte boundary
#
#
[COMMON]
FC : gfortran -ffree-line-length-none -I .
LAPACK_LIB : -lblas -llapack
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32
# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
[OPTION]
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 1 ; Enable cache_compile.py
OPENMP : 1 ; Append OpenMP flags
# Optimization flags
####################
#
# -march=native : Compile a binary optimized for the current architecture
# -Ofast : Disregard strict standards compliance. Enables all -O3 optimizations.
# It also enables optimizations that are not valid
# for all standard-compliant programs. It turns on
# -ffast-math and the Fortran-specific
# -fno-protect-parens and -fstack-arrays.
[OPT]
FCFLAGS : -Ofast -march=native
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -Ofast -march=native
# Debugging flags
#################
#
# -fcheck=all : Checks uninitialized variables, array subscripts, etc...
# -g : Extra debugging information
#
[DEBUG]
FCFLAGS : -fcheck=all -g
# OpenMP flags
#################
#
[OPENMP]
FC : -fopenmp
IRPF90_FLAGS : --openmp

62
config/ifort_example.cfg Normal file
View File

@ -0,0 +1,62 @@
# 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
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 : 1 ; 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 : -xHost -O2 -ip -opt-prefetch -ftz
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -xHost -O2 -ip -opt-prefetch -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
# OpenMP flags
#################
#
[OPENMP]
FC : -fopenmp
IRPF90_FLAGS : --openmp

View File

@ -0,0 +1,42 @@
# `ei_handler.py`
This script in located in `$QPACKAGE_ROOT/scripts/ezfio_interface/`.
It provide all the resource need to deal with the `EZFIO.cfg` files :
- The creation of `$MODULE_LOWER_ezfio_config` in `$QPACKAGE_ROOT/ezfio/config`
- The `ezfio_interface.irp.f` who containt all the provider associate (in `$MODULE/`)
- The `$MODULE_LOWER_ezfio_defaults` in `$QPACKAGE_ROOT/data/`
- The `Input_$MODULE_LOWER.ml` for the *qp_edit*
For more information you can type `ei_handler.py -h`
# `module_handler.py`
This script in located in `$QPACKAGE_ROOT/scripts/module/`.
It provide all the resource related to the tree dependancy of the modules.
If more useful as a librairy than a cli.
It have some usefull property:
- The list of module
- The dict of the descendant
- The dict of the parent
- The dict of the child
- The dict of the root
- The list reduced tree (For a list of module in input return only the root)
In the cli mode:
- From a `NEEDED_CHILDREN_MODULE` file you can have all the descendant, and a png
representation who correspond.
# `qp_install_module.py`
This script is located in `$QPACKAGE_ROOT/scripts/module/`.
It is usefull when you need to install a new module. (From the soon to come repo or from scratch).
# `qp_create_ninja.py`
This script is located in `$QPACKAGE_ROOT/scripts/compilation/`.
It will create the `build.ninja` file. It will use intersifly the `module_handler.py` module.
To read all the flag for the compilation the module `read_compilation_cfg.py` is used.
You only need to know, that all flag are appending.

View File

50
ocaml/.gitignore vendored Normal file
View File

@ -0,0 +1,50 @@
.gitignore
ezfio.ml
Qptypes.ml
qptypes_generator.byte
_build
qp_basis_clean.native
qp_create_ezfio_from_xyz.native
qp_edit.native
qp_print.native
qp_run.native
qp_set_ddci.native
qp_set_mo_class.native
qp_edit.native
test_atom.byte
test_basis.byte
test_bitlist.byte
test_determinants.byte
test_elements.byte
test_excitation.byte
test_gto.byte
test_mo_label.byte
test_molecule.byte
test_point3d.byte
test_atom
test_basis
test_bitlist
test_determinants
test_elements
test_excitation
test_gto
test_mo_label
test_molecule
test_point3d
qp_basis_clean
qp_create_ezfio_from_xyz
qp_edit
qp_print
qp_run
qp_set_ddci
qp_set_mo_class
Input_pseudo.ml
Input_integrals_bielec.ml
Input_hartree_fock.ml
Input_perturbation.ml
Input_determinants.ml
Input_properties.ml
qp_edit.ml
qp_edit
qp_edit.native
Input_auto_generated.ml

View File

@ -13,10 +13,10 @@ LIBS=
PKGS=
OCAMLCFLAGS="-g -warn-error A"
OCAMLBUILD=ocamlbuild -j 0 -syntax camlp4o -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS)
MLFILES=$(wildcard *.ml) ezfio.ml Qptypes.ml
MLFILES=$(wildcard *.ml) ezfio.ml Qptypes.ml Input_auto_generated.ml qp_edit.ml
MLIFILES=$(wildcard *.mli)
ALL_TESTS=$(patsubst %.ml,%.byte,$(wildcard test_*.ml))
ALL_EXE=$(patsubst %.ml,%.native,$(wildcard qp_*.ml))
ALL_EXE=$(patsubst %.ml,%.native,$(wildcard qp_*.ml)) qp_edit.native
.PHONY: executables default
@ -27,7 +27,7 @@ default: $(ALL_TESTS) $(ALL_EXE) .gitignore
@for i in .gitignore ezfio.ml Qptypes.ml qptypes_generator.byte _build $(ALL_EXE) $(ALL_TESTS) \
$(patsubst %.ml,%,$(wildcard test_*.ml)) $(patsubst %.ml,%,$(wildcard qp_*.ml)) \
$(shell grep Input Input_auto_generated.ml | awk '{print $$2 ".ml"}') \
Input_auto_generated.ml;\
qp_edit.ml qp_edit qp_edit.native Input_auto_generated.ml;\
do \
echo $$i ; \
done > .gitignore
@ -35,7 +35,7 @@ default: $(ALL_TESTS) $(ALL_EXE) .gitignore
executables: $(QPACKAGE_ROOT)/data/executables
$(QPACKAGE_ROOT)/data/executables:
$(QPACKAGE_ROOT)/scripts/create/create_executables_list.sh
$(QPACKAGE_ROOT)/scripts/module/create_executables_list.sh
external_libs:
opam install cryptokit core
@ -74,5 +74,9 @@ Qptypes.ml: qptypes_generator.byte
${QPACKAGE_ROOT}/EZFIO/Ocaml/ezfio.ml:
$(MAKE) -C ${QPACKAGE_ROOT}/src ezfio
Input_auto_generated.ml qp_edit.ml:
ei_handler.py ocaml_global
clean:
rm -rf _build Qptypes.ml $(ALL_EXE) $(ALL_TESTS)
rm -rf _build Qptypes.ml Input_auto_generated.ml $(ALL_EXE) $(ALL_TESTS)

1
scripts/compilation/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.pyc

View File

@ -0,0 +1,108 @@
#!/usr/bin/env python
"""
Save the .o from a .f90
and is the .o is asked a second time, retur it
Take in argv command like:
ifort -g -openmp -I IRPF90_temp/Ezfio_files/ -c IRPF90_temp/Integrals_Monoelec/kin_ao_ints.irp.module.F90 -o IRPF90_temp/Integrals_Monoelec/kin_ao_ints.irp.module.o
"""
import os
import sys
import hashlib
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)?',
re.MULTILINE | re.IGNORECASE)
TMPDIR = "/tmp/qp_compiler/"
def return_filename_to_cache(command):
"""
For a irp_command:
ifort -g -openmp -I IRPF90_temp/Ezfio_files/ -c IRPF90_temp/Integrals_Monoelec/kin_ao_ints.irp.module.F90 -o IRPF90_temp/Integrals_Monoelec/kin_ao_ints.irp.module.o
Return the *.F90 and the *.o
"""
command_clean = p.sub('', command)
match = r.search(command_clean)
input = match.group(1)
output = match.group(2)
return (input, output)
def get_hash_key(command, input_data):
"""
Return the hash of command + input_data
"""
m = hashlib.md5()
m.update(command)
m.update(input_data)
# Md5 Key containing command + content of Fread
return m.hexdigest()
def run_and_save_the_data(command, path_output, path_key, is_mod):
# Compile the file -> .o
process = subprocess.Popen(command, shell=True)
if process.wait() != 0:
sys.exit(1)
elif not is_mod:
try:
shutil.copyfile(path_output, path_key)
except:
pass
def cache_utility(command):
# Create temp directory
try:
os.mkdir("/tmp/qp_compiler/")
except OSError:
pass
# Get the filename of the input.f.90
# and the otput .o
try:
(path_input, path_output) = return_filename_to_cache(command)
except:
# Canot parse the arg of command
raise OSError
try:
with open(path_input, 'r') as f:
input_data = f.read()
# Get the hash
key = get_hash_key(command, input_data)
path_key = os.path.join(TMPDIR, key)
# Try to return the content of the .o file
try:
shutil.copyfile(path_key, path_output)
except IOError:
is_mod = mod.search(input_data.replace('\n', ' '))
run_and_save_the_data(command, path_output, path_key, is_mod)
except:
raise
if __name__ == '__main__':
line = sys.argv[1:]
command = " ".join(line)
try:
cache_utility(command)
except:
process = subprocess.Popen(command, shell=True)

View File

@ -0,0 +1,698 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage: qp_create_ninja.py (--development | --production) CONFIG_FILE
"""
import os
import sys
import glob
from os.path import join
from collections import namedtuple
from collections import defaultdict
try:
from module_handler import ModuleHandler
from read_compilation_cfg import get_compilation_option
from docopt import docopt
except ImportError:
print "source .quantum_package.rc"
sys.exit(1)
# __
# /__ | _ |_ _. | _. ._ o _. |_ | _ _
# \_| | (_) |_) (_| | \/ (_| | | (_| |_) | (/_ _>
#
QPACKAGE_ROOT = os.environ['QPACKAGE_ROOT']
QPACKAGE_ROOT_SRC = join(QPACKAGE_ROOT, 'src')
QPACKAGE_ROOT_EZFIO = join(QPACKAGE_ROOT, 'EZFIO')
EZFIO_LIB = join(QPACKAGE_ROOT_EZFIO, "lib", "libezfio.a")
#
# |\ | _. ._ _ _ _| _|_ ._ | _
# | \| (_| | | | (/_ (_| |_ |_| |_) | (/_
# |
Path = namedtuple('Path', ['abs', 'rel'])
EZ_config_path = namedtuple('EZ_config', ['path_in_module', 'path_in_ezfio'])
EZ_handler = namedtuple('EZ_handler', ['ez_module', 'ez_cfg', 'ez_interface',
'ez_config'])
Sym_link = namedtuple('Sym_link', ['source', 'destination'])
# _
# |_ ._ _. ._ o _. |_ | _ _
# |_ | | \/ \/ (_| | | (_| |_) | (/_ _>
def ninja_create_env_variable(pwd_config_file):
"""
Return some ninja varible with the env variable expanded
FC, FCFLAGS, IRPF90, IRPF90_FLAGS
The env variable is usefull for the generation of EZFIO, and IRPF90
"""
l_string = []
for flag in ["FC", "FCFLAGS", "IRPF90", "IRPF90_FLAGS"]:
str_ = "{0} = {1}".format(flag, get_compilation_option(pwd_config_file,
flag))
l_string.append(str_)
lib_lapack = get_compilation_option(pwd_config_file, "LAPACK_LIB")
lib_ezfio = join(QPACKAGE_ROOT_EZFIO, "lib", "libezfio_irp.a")
l_string.append("{0} = {1} {2}".format("LIB", lib_lapack, lib_ezfio))
l_string.append("")
return l_string
# __
# /__ _ ._ _ _. | _ _
# \_| (/_ | | (/_ (_| | (_) (_| \/
# _| /
def dict_module_genelogy_path(d_module_genelogy):
"""
Just a dict with relative, and absolue path for the
d_module_genelogy
"""
d = dict()
for module_rel, l_children_rel in d_module_genelogy.iteritems():
module_abs = join(QPACKAGE_ROOT_SRC, module_rel)
p = Path(module_abs, module_rel)
try:
d[p] = Path(join(QPACKAGE_ROOT_SRC, l_children_rel),
l_children_rel)
except:
d[p] = [Path(join(QPACKAGE_ROOT_SRC, children), children)
for children in l_children_rel]
return d
# _ __ _ ___ _ _
# |_ / |_ | / \ _ _|_ _
# |_ /_ | _|_ \_/ o (_ | (_|
# _|
def get_l_module_with_ezfio_cfg():
"""
Return all the module who have a EZFIO.cfg
"""
from os import listdir
from os.path import isfile, join
qp_src = QPACKAGE_ROOT_SRC
return [join(qp_src, m) for m in listdir(qp_src)
if isfile(join(qp_src, m, "EZFIO.cfg"))]
def get_l_ezfio_config():
"""
Return a namedtuple('EZ_config', ['path_in_module', 'path_in_ezfio'])
"""
l = []
cmd = "{0}/*/*.ezfio_config".format(QPACKAGE_ROOT_SRC)
for path_in_module in glob.glob(cmd):
name_lower = os.path.split(path_in_module)[1].lower()
path_in_ezfio = join(QPACKAGE_ROOT_EZFIO, "config", name_lower)
l.append(EZ_config_path(path_in_module, path_in_ezfio))
return l
def ninja_ezfio_cfg_rule():
"""
Return the ezfio_interface rule who will create
the _ezfio_interface.irp.f the _ezfio_config from the EZFIO.cfg
"""
l_string = ["rule build_ezfio_interface",
" command = ei_handler.py --path_module $sub_module", ""]
return l_string
def ninja_ezfio_config_rule():
"""
If a ezfio_config existe you just need to move it
"""
l_string = ["rule build_ezfio_config", " command = cp $in $out", ""]
return l_string
def get_children_of_ezfio_cfg(l_module_with_ezfio_cfg):
"""
From a module list of ezfio_cfg return all the stuff create by him
"""
config_folder = join(QPACKAGE_ROOT_EZFIO, "config")
l_util = dict()
for m in l_module_with_ezfio_cfg:
name_module = os.path.split(m)[1]
name_module_lower = name_module.lower()
rel = name_module
abs_ = m
ez_module = Path(abs_, rel)
rel = "EZFIO.cfg"
abs_ = join(m, "EZFIO.cfg")
ez_cfg = Path(abs_, rel)
rel = "ezfio_interface.irp.f"
abs_ = join(m, rel)
ez_interface = Path(abs_, rel)
rel = "{0}.ezfio_interface_config".format(name_module_lower)
abs_ = join(config_folder, rel)
ez_config = Path(abs_, rel)
l_util[ez_module.rel] = EZ_handler(ez_module, ez_cfg, ez_interface,
ez_config)
return l_util
def ninja_ezfio_cfg_build(l_util):
"""
Return the children created by EZFIO.cfg
For us is only ez_interface.irp.f and ez_config
"""
l_string = []
for m in l_util.itervalues():
str_ = "build {1} {2}: build_ezfio_interface {0}"
l_string += [str_.format(m.ez_cfg.abs, m.ez_interface.abs,
m.ez_config.abs)]
l_string += [" sub_module = {0}".format(m.ez_module.abs)]
l_string += [""]
return l_string
def ninja_ezfio_config_build(l_ezfio_config):
"""
For the ezfio_config present in module move then
"""
l_string = []
for m in l_ezfio_config:
file_source = m.path_in_module
file_create = m.path_in_ezfio
l_string += ["build {0}: build_ezfio_config {1}".format(file_create,
file_source)]
l_string += [""]
return l_string
def ninja_ezfio_rule():
"""
Retun the rule for creation the ezfio
Set some variable
and run ninja
"""
l_flag = ["export {0}='${0}'".format(flag)
for flag in ["FC", "FCFLAGS", "IRPF90"]]
l_cmd = ["cd {0}".format(QPACKAGE_ROOT_EZFIO)
] + l_flag + ["ninja"]
l_string = ["rule build_ezfio",
" command = {0}".format(" ; ".join(l_cmd)),
" description = Create $out"
""]
return l_string
def ninja_ezfio_build(l_ezfio_config, l_util):
"""
Rule for create the ezfio
we depend of the ezfio_config set by the user or created bu EZFIO.cfg
"""
l_ezfio_config = [i.path_in_ezfio for i in l_ezfio_config]
l_ezfio_from_cfg = [i.ez_config.abs for i in l_util.itervalues()]
str_ = " ".join(l_ezfio_config + l_ezfio_from_cfg)
ezfio_make_config = join(QPACKAGE_ROOT_EZFIO,"make.config")
l_string = ["build {0} {1}: build_ezfio {2}".format(EZFIO_LIB,
ezfio_make_config,
str_), ""]
return l_string
# __
# (_ ._ _ | o ._ |
# __) \/ | | | | | | | |<
# /
def get_source_destination(path_module, l_needed_molule):
"""
Return a list of Sym_link = namedtuple('Sym_link', ['source', 'destination'])
for a module
"""
return [Sym_link(m.abs, join(QPACKAGE_ROOT_SRC, path_module.rel, m.rel))
for m in l_needed_molule]
def ninja_symlink_rule():
"""
Return the command to create for the symlink
"""
return ["rule build_symlink", " command = ln -sf $in $out", ""]
def ninja_symlink_build(path_module, l_symlink):
"""
Create the symlink
and the l_symlink who are all the symlink list
"""
if not l_symlink:
return []
l_string = ["build l_symlink_{0} : phony {1}".format(
path_module.rel, " ".join([s.destination for s in l_symlink])), ""]
for symlink in l_symlink:
l_string += ["build {0}: build_symlink {1}".format(symlink.destination,
symlink.source), ""]
return l_string
# _ _ _
# o ._ ._ _|_ (_| / \ ._ _ _. | _
# | | |_) | | \_/ o | | | (_| |< (/_
# |
def get_l_file_for_module(path_module_abs):
'''
return the list of irp.f in a module
'''
l_irp = []
l_src = []
l_obj = []
l_template = []
for f in os.listdir(path_module_abs):
if f.lower().endswith(tuple([".template.f", ".include.f"])):
l_template.append(join(path_module_abs, f))
elif f.endswith(".irp.f"):
l_irp.append(join(path_module_abs, f))
elif f.lower().endswith(tuple([".f", ".f90", ".c", ".cpp", ".cxx"])):
l_src.append(join(path_module_abs, f))
obj = '{0}.o'.format(os.path.splitext(f)[0])
l_obj.append(join(path_module_abs, obj))
elif f == "EZFIO.cfg":
l_irp.append(join(path_module_abs, "ezfio_interface.irp.f"))
d = {"l_irp": l_irp,
"l_src": l_src,
"l_obj": l_obj,
"l_template": l_template}
return d
def get_file_dependency(d_info_module):
"""
For a module return all the irp.f90 file who depend
"""
d_irp = defaultdict(dict)
for module, l_children in d_info_module.iteritems():
for key, values in get_l_file_for_module(module.abs).iteritems():
d_irp[module][key] = values
for children in l_children:
for key, values in get_l_file_for_module(children.abs).iteritems():
d_irp[module][key].extend(values)
return d_irp
def ninja_irpf90_make_rule():
"""
The rule for creating the irpf90.make
Export the flag and compile
Only secontial make a possible
"""
# ~#~#~#~#~ #
# F l a g s #
# ~#~#~#~#~ #
l_flag = []
for flag in ["FC", "FCFLAGS", "LIB", "SRC", "OBJ"]:
str_ = "export {0}='${0}'".format(flag)
l_flag.append(str_)
# ~#~#~ #
# c m d #
# ~#~#~ #
l_cmd = ["cd $module"] + l_flag + ["irpf90 $include_dir $IRPF90_FLAGS"]
# ~#~#~#~#~#~ #
# s t r i n g #
# ~#~#~#~#~#~ #
l_string = ["pool irp_pool", " depth = 1", "", "rule build_irpf90.ninja",
" command = {0}".format(" ; ".join(l_cmd)),
" pool = irp_pool",
" description = Create the IRP_Tree for $module", ""]
return l_string
def ninja_irpf90_make_build(path_module, l_needed_molule, d_irp):
"""
Creatre the dependency for a irpf90.make
We need all the symklink and all the irp.f
"""
# ~#~#~#~#~#~ #
# O u t p u t #
# ~#~#~#~#~#~ #
l_creation = [join(path_module.abs, i)
for i in ["irpf90.make", "irpf90_entities", "tags",
"IRPF90_temp/build.ninja"]]
str_creation = " ".join(l_creation)
# ~#~#~#~#~#~#~#~#~#~ #
# D e p e n d a n c y #
# ~#~#~#~#~#~#~#~#~#~ #
l_irp_need = d_irp[path_module]["l_irp"]
l_src = d_irp[path_module]["l_src"]
l_obj = d_irp[path_module]["l_obj"]
l_template = d_irp[path_module]["l_template"]
if l_needed_molule:
l_destination = ["l_symlink_{0}".format(path_module.rel)]
else:
l_destination = []
str_depend = " ".join(l_irp_need + l_destination + l_src + l_template)
# ~#~#~#~#~#~#~#~#~#~#~ #
# N i n j a _ b u i l d #
# ~#~#~#~#~#~#~#~#~#~#~ #
l_include_dir = ["-I {0}".format(m.rel) for m in l_needed_molule]
l_string = [
"build {0}: build_irpf90.ninja {1}".format(str_creation, str_depend),
" module = {0}".format(path_module.abs),
" SRC = {0}".format(" ".join(l_src)),
" OBJ = {0}".format(" ".join(l_obj)),
" include_dir = {0}".format(" ".join(l_include_dir)), ""
]
return l_string
def ninja_readme_rule():
"""
Rule for creation the readme.
For not dealted the readme when ninja -t clean and the generator option
"""
l_string = ["rule build_readme",
" command = cd $module ; update_README.py",
" generator = 1", ""]
return l_string
def ninja_readme_build(path_module):
"""
Rule for creation the readme
"""
path_irp_man = join(path_module.abs, "irpf90.make")
path_readme = join(path_module.abs, "README.rst")
l_string = ["build {0}: build_readme {1}".format(path_readme,
path_irp_man),
" module = {0}".format(path_module.abs), ""]
return l_string
# _
# |_) o ._ _. ._
# |_) | | | (_| | \/
# /
def get_binaries(path_module):
"""
Return the list of binaries (Path= namedtuple('Path', ['abs', 'rel']) for a module
"""
import subprocess
try:
cmd = 'grep -l "program" {0}/*.irp.f'.format(path_module.abs)
process = subprocess.Popen([cmd],
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
except OSError:
return []
else:
if not stdout:
return []
elif "No such file or directory" not in stdout:
l_bin = [i.replace(".irp.f", "", 1) for i in stdout.split()]
return [Path(bin_, os.path.basename(bin_)) for bin_ in l_bin]
else:
return []
def get_dict_binaries(l_module, mode="production"):
"""
Return a dict [module] = list_binaries
If a the production mode is enable only header module
who will produce all binaries
Example : The module Full_CI can produce the binary SCF
so you dont need to compile at all the module Hartree-Fock
"""
d_binaries = defaultdict(list)
# Create d_binaries
# Ake module => binaries generated
for module in l_module:
l_binaries = get_binaries(module)
if l_binaries:
d_binaries[module] += l_binaries
if mode == "production":
dict_root = ModuleHandler.dict_root
dict_root_path = dict_module_genelogy_path(dict_root)
d_binaries_condensed = defaultdict(list)
for module in d_binaries:
d_binaries_condensed[dict_root_path[module]] += d_binaries[module]
d_binaries = d_binaries_condensed
return d_binaries
def ninja_binaries_rule():
"""
Rule for creating the binaries
"""
# ~#~#~ #
# c m d #
# ~#~#~ #
l_cmd = ["cd $module/IRPF90_temp", "ninja"]
# ~#~#~#~#~#~ #
# s t r i n g #
# ~#~#~#~#~#~ #
l_string = ["rule build_binaries",
" command = {0}".format(" ; ".join(l_cmd)),
" description = Create all the binaries from $module", ""]
return l_string
def ninja_binaries_build(path_module, l_children, d_binaries):
"""
The binaries need the EZFIO_LIB, and the irpf90.make (aka build.ninja)
"""
# ~#~#~ #
# c m d #
# ~#~#~ #
ninja_module_path = join(path_module.abs, "IRPF90_temp", "build.ninja")
l_abs_bin = [binary.abs for binary in d_binaries[path_module]]
# ~#~#~#~#~#~ #
# s t r i n g #
# ~#~#~#~#~#~ #
l_string = ["build {0}: build_binaries {1} {2}".format(" ".join(l_abs_bin),
EZFIO_LIB,
ninja_module_path),
" module = {0}".format(path_module.abs), ""]
return l_string
# ___
# | ._ _ _ _| _ ._ _ ._ _| _ ._ _ o _ _
# | | (/_ (/_ (_| (/_ |_) (/_ | | (_| (/_ | | (_ | (/_ _>
# |
def ninja_dot_tree_rule():
"""
Rule for creating the binaries
"""
# ~#~#~ #
# c m d #
# ~#~#~ #
l_cmd = ["cd $module", "module_handler.py create_png"]
l_string = ["rule build_dot_tree",
" command = {0}".format(" ; ".join(l_cmd)),
" generator = 1",
" description = Generate Png representtion of the Tree Dependancies of $module",
""]
return l_string
def ninja_dot_tree_build(path_module):
path_tree = join(path_module.abs, "tree_dependency.png")
l_string = ["build {0}: build_dot_tree".format(path_tree),
" module = {0}".format(path_module.abs), ""]
return l_string
#
# |\/| _. o ._
# | | (_| | | |
#
if __name__ == "__main__":
arguments = docopt(__doc__)
pwd_config_file = arguments["CONFIG_FILE"]
# _
# |_ ._ _. ._ o _. |_ | _ _
# |_ | | \/ \/ (_| | | (_| |_) | (/_ _>
#
l_string = ninja_create_env_variable(pwd_config_file)
# _
# |_) | _
# | \ |_| | (/_
#
l_string += ninja_ezfio_cfg_rule()
l_string += ninja_symlink_rule()
l_string += ninja_irpf90_make_rule()
l_string += ninja_readme_rule()
l_string += ninja_binaries_rule()
l_string += ninja_ezfio_config_rule()
l_string += ninja_ezfio_rule()
l_string += ninja_dot_tree_rule()
# _
# |_) o | _| _ _ ._ _ ._ _. |
# |_) |_| | | (_| (_| (/_ | | (/_ | (_| |
# _|
l_module_with_ezfio_cfg = get_l_module_with_ezfio_cfg()
l_util = get_children_of_ezfio_cfg(l_module_with_ezfio_cfg)
l_ezfio_config = get_l_ezfio_config()
l_string += ninja_ezfio_cfg_build(l_util)
l_string += ninja_ezfio_config_build(l_ezfio_config)
l_string += ninja_ezfio_build(l_ezfio_config, l_util)
# _ _
# |_) o | _| _|_ _ ._ ._ _ _ _| | _
# |_) |_| | | (_| | (_) | | | | (_) (_| |_| | (/_
#
#
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
# G e n e a l o g y _ d i c t #
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
d_genealogy = ModuleHandler.dict_descendant
d_genealogy_path = dict_module_genelogy_path(d_genealogy)
d_irp = get_file_dependency(d_genealogy_path)
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 #
# ~#~#~#~#~#~#~#~#~#~#~#~#~ #
if arguments["--production"]:
l_module_to_irp = d_binaries_production.keys()
elif arguments["--development"]:
l_module_to_irp = d_genealogy_path.keys()
for module_to_compile in l_module_to_irp:
# ~#~#~#~#~#~#~#~ #
# S y m l i n k #
# ~#~#~#~#~#~#~#~ #
l_children = d_genealogy_path[module_to_compile]
l_symlink = get_source_destination(module_to_compile, l_children)
l_string += ninja_symlink_build(module_to_compile, l_symlink)
# ~#~#~#~#~#~#~#~ #
# i r p . f 9 0 #
# ~#~#~#~#~#~#~#~ #
l_string += ninja_irpf90_make_build(module_to_compile, l_children,
d_irp)
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
# d o t _ t r e e & r e a d m e #
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
l_string += ninja_dot_tree_build(module_to_compile)
l_string += ninja_readme_build(module_to_compile)
# ~#~#~#~#~#~#~ #
# b i n a r y #
# ~#~#~#~#~#~#~ #
for module_to_compile in d_binaries_production.keys():
l_string += ninja_binaries_build(module_to_compile, l_children,
d_binaries_production)
with open(join(QPACKAGE_ROOT, "build.ninja"), "w+") as f:
f.write("\n".join(l_string))

View File

@ -0,0 +1,43 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import ConfigParser
def get_l_option_section(config):
"""List of options chosen by the user"""
l = [o for o in ['OPENMP'] if config.getboolean("OPTION", o)]
l.append(config.get("OPTION", "MODE").strip())
return l
def get_compilation_option(pwd_cfg, flag_name):
"""
Return the flag compilation of a compile.cfg located in pwd_cfg
"""
config = ConfigParser.ConfigParser()
config.read(pwd_cfg)
if flag_name == "FC" and config.getboolean("OPTION","CACHE"):
l = ["cache_compile.py"]
else:
l = []
l_option_section = get_l_option_section(config)
for section in ["COMMON"] + l_option_section:
try:
l.extend(config.get(section, flag_name).split())
except ConfigParser.NoOptionError:
pass
return " ".join(l)
if __name__ == '__main__':
qpackage_root = os.environ['QPACKAGE_ROOT']
pwd_cfg = os.path.join(qpackage_root, "config/gfortran_example.cfg")
print get_compilation_option(pwd_cfg, "FC")
print get_compilation_option(pwd_cfg, "FCFLAGS")

View File

@ -5,13 +5,17 @@ Welcom the ei_handler.
We will create all the ezfio related stuff from a EZFIO.cfg file.
Usage:
ei_handler.py [--path] [--irpf90] [--ezfio_config] [--ocaml] [--ezfio_default] [--global]
ei_handler.py [--path_module=<module>]
[--irpf90]
[--ezfio_config]
[--ocaml]
[--ezfio_default]
ei_handler.py ocaml_global
By default all the option are executed.
Options:
-h --help
--path The path of the `EZFIO.cfg`, by default will look in the ${pwd}
--irpf90 Create the `ezfio_interface.irpf90`
which contains all the providers needed
(aka all with the `interface: input` parameter)
@ -23,7 +27,7 @@ Options:
--ezfio_default Create the `${module_lower}_ezfio_interface_default` in
`${QPACKAGE_ROOT}/data/ezfio_defaults` needed by
the ocaml
--global Create all the stuff who need all the EZFIO.cfg
ocaml_global Create the qp_edit
Format specification :
[provider_name] | the name of the provider in irp.f90
@ -62,8 +66,11 @@ import ConfigParser
from collections import defaultdict
from collections import namedtuple
from decorator import cache
from qp_utils import cache
from os import listdir
from os.path import isdir, join, exists
Type = namedtuple('Type', 'fancy ocaml fortran')
@ -172,12 +179,12 @@ def get_type_dict():
type_dict = get_type_dict()
def get_dict_config_file(config_file_path, module_lower):
def get_dict_config_file(module_obj):
"""
Input:
config_file_path is the config file path
module_obj.path is the config file
(for example FULL_PATH/EZFIO.cfg)
module_lower is the MODULE name lowered
module_obj.lower is the MODULE name lowered
(Ex fullci)
Return a dict d[provider_name] = {type,
@ -204,7 +211,6 @@ def get_dict_config_file(config_file_path, module_lower):
# ~#~#~#~ #
# I n i t #
# ~#~#~#~ #
d = defaultdict(dict)
l_info_required = ["doc", "interface"]
l_info_optional = ["ezfio_dir", "ezfio_name", "size"]
@ -214,14 +220,14 @@ def get_dict_config_file(config_file_path, module_lower):
# ~#~#~#~#~#~#~#~#~#~#~ #
config_file = ConfigParser.ConfigParser()
config_file.readfp(open(config_file_path))
config_file.readfp(open(module_obj.path))
# ~#~#~#~#~#~#~#~#~ #
# F i l l _ d i c t #
# ~#~#~#~#~#~#~#~#~ #
def error(o, p, c):
"o option ; p provider_name ;c config_file_path"
"o option ; p provider_name ;c module_obj.path"
print "You need a {0} for {1} in {2}".format(o, p, c)
for section in config_file.sections():
@ -230,7 +236,7 @@ def get_dict_config_file(config_file_path, module_lower):
# Create the dictionary who containt the value per default
d_default = {"ezfio_name": pvd,
"ezfio_dir": module_lower,
"ezfio_dir": module_obj.lower,
"size": "1"}
# Check if type if avalaible
@ -247,7 +253,7 @@ def get_dict_config_file(config_file_path, module_lower):
try:
d[pvd][option] = config_file.get(section, option)
except ConfigParser.NoOptionError:
error(option, pvd, config_file_path)
error(option, pvd, module_obj.path)
sys.exit(1)
# Fill the dict with OPTIONAL information
@ -263,7 +269,7 @@ def get_dict_config_file(config_file_path, module_lower):
try:
default_raw = config_file.get(section, "default")
except ConfigParser.NoOptionError:
error("default", pvd, config_file_path)
error("default", pvd, module_obj.path)
sys.exit(1)
try:
@ -318,14 +324,6 @@ def save_ezfio_provider(path_head, dict_code_provider):
path = "{0}/ezfio_interface.irp.f".format(path_head)
try:
f = open(path, "r")
except IOError:
old_output = ""
else:
old_output = f.read()
f.close()
l_output = ["! DO NOT MODIFY BY HAND",
"! Created by $QPACKAGE_ROOT/scripts/ezfio_interface.py",
"! from file {0}/EZFIO.cfg".format(path_head),
@ -335,9 +333,8 @@ def save_ezfio_provider(path_head, dict_code_provider):
output = "\n".join(l_output)
if output != old_output:
with open(path, "w+") as f:
f.write(output)
with open(path, "w+") as f:
f.write(output)
def create_ezfio_stuff(dict_ezfio_cfg, config_or_default="config"):
@ -442,6 +439,7 @@ def create_ezfio_stuff(dict_ezfio_cfg, config_or_default="config"):
raise KeyError
# Append
result.append(s)
result.append("\n")
return "\n".join(result)
@ -461,17 +459,8 @@ def save_ezfio_config(module_lower, str_ezfio_config):
path = "{0}/config/{1}.ezfio_interface_config".format(root_ezfio,
module_lower)
try:
f = open(path, "r")
except IOError:
old_output = ""
else:
old_output = f.read()
f.close()
if str_ezfio_config != old_output:
with open(path, "w+") as f:
f.write(str_ezfio_config)
with open(path, "w+") as f:
f.write(str_ezfio_config)
def create_ezfio_default(dict_ezfio_cfg):
@ -489,18 +478,8 @@ def save_ezfio_default(module_lower, str_ezfio_default):
os.environ['QPACKAGE_ROOT'])
path = "{0}/{1}.ezfio_interface_default".format(root_ezfio_default,
module_lower)
try:
f = open(path, "r")
except IOError:
old_output = ""
else:
old_output = f.read()
f.close()
if str_ezfio_default != old_output:
with open(path, "w+") as f:
f.write(str_ezfio_default)
with open(path, "w+") as f:
f.write(str_ezfio_default)
def create_ocaml_input(dict_ezfio_cfg, module_lower):
@ -524,6 +503,7 @@ def create_ocaml_input(dict_ezfio_cfg, module_lower):
if not l_ezfio_name:
raise ValueError
e_glob = EZFIO_ocaml(l_ezfio_name=l_ezfio_name,
l_type=l_type,
l_doc=l_doc)
@ -606,20 +586,11 @@ def save_ocaml_input(module_lower, str_ocaml_input):
path = "{0}/ocaml/Input_{1}.ml".format(os.environ['QPACKAGE_ROOT'],
module_lower)
try:
f = open(path, "r")
except IOError:
old_output = ""
else:
old_output = f.read()
f.close()
if str_ocaml_input != old_output:
with open(path, "w+") as f:
f.write(str_ocaml_input)
with open(path, "w+") as f:
f.write(str_ocaml_input)
def get_l_module_lower():
def get_l_module_with_auto_generate_ocaml_lower():
"""
Get all module who have EZFIO.cfg with input data
(NB `search` in all the ligne and `match` only in one)
@ -635,9 +606,6 @@ def get_l_module_lower():
# L _ f o l d e r #
# ~#~#~#~#~#~#~#~ #
from os import listdir
from os.path import isdir, join, exists
l_folder = [f for f in listdir(mypath) if isdir(join(mypath, f))]
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
@ -662,18 +630,11 @@ def get_l_module_lower():
return l_module_lower
def create_ocaml_input_global():
def create_ocaml_input_global(l_module_with_auto_generate_ocaml_lower):
"""
Check for all the EZFIO.cfg get the module lower
then create incule {module_lower}.ml
Create the Input_auto_generated.ml and qp_edit.ml str
"""
# ~#~#~#~# #
# I n i t #
# ~#~#~#~# #
l_module_lower = get_l_module_lower()
# ~#~#~#~#~#~#~#~# #
# C r e a t i o n #
# ~#~#~#~#~#~#~#~# #
@ -686,7 +647,7 @@ def create_ocaml_input_global():
with open(path, "r") as f:
template_raw = f.read()
e = EZFIO_ocaml(l_module_lower=l_module_lower)
e = EZFIO_ocaml(l_module_lower=l_module_with_auto_generate_ocaml_lower)
template = template_raw.format(keywords=e.create_qp_keywords(),
keywords_to_string=e.create_qp_keywords_to_string(),
@ -707,17 +668,8 @@ def save_ocaml_input_auto(str_ocaml_input_global):
path = "{0}/ocaml/Input_auto_generated.ml".format(os.environ['QPACKAGE_ROOT'])
try:
f = open(path, "r")
except IOError:
old_output = ""
else:
old_output = f.read()
f.close()
if str_ocaml_input_global != old_output:
with open(path, "w+") as f:
f.write(str_ocaml_input_global)
with open(path, "w+") as f:
f.write(str_ocaml_input_global)
def save_ocaml_qp_edit(str_ocaml_qp_edit):
@ -728,55 +680,14 @@ def save_ocaml_qp_edit(str_ocaml_qp_edit):
path = "{0}/ocaml/qp_edit.ml".format(os.environ['QPACKAGE_ROOT'])
try:
f = open(path, "r")
except IOError:
old_output = ""
else:
old_output = f.read()
f.close()
if str_ocaml_qp_edit != old_output:
with open(path, "w+") as f:
f.write(str_ocaml_qp_edit)
with open(path, "w+") as f:
f.write(str_ocaml_qp_edit)
if __name__ == "__main__":
arguments = docopt(__doc__)
# ___
# | ._ o _|_
# _|_ | | | |_
#
def code_generation(arguments, dict_ezfio_cfg, m):
if not arguments["--global"]:
if not arguments["--path"]:
config_file_path = "EZFIO.cfg"
if "EZFIO.cfg" not in os.listdir(os.getcwd()):
sys.exit(0)
else:
config_file_path = arguments["path"]
# Get the full path
config_file_path = os.path.expanduser(config_file_path)
config_file_path = os.path.expandvars(config_file_path)
config_file_path = os.path.abspath(config_file_path)
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~# #
# G e t _ m o d u l e _ d i r #
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~# #
path_dirname = os.path.dirname(config_file_path)
module = [i for i in path_dirname.split("/") if i][-1]
module_lower = module.lower()
# Because we only authorise this right now!
ezfio_dir = module_lower
dict_ezfio_cfg = get_dict_config_file(config_file_path, ezfio_dir)
# _
# / _ _| _ _ _ ._ _ ._ _. _|_ o _ ._
# \_ (_) (_| (/_ (_| (/_ | | (/_ | (_| |_ | (_) | |
# _|
module_lower = m.lower
path_dirname = m.path.replace("/EZFIO.cfg", "")
# ~#~#~#~#~#~#~#~#~#~ #
# W h a t _ t o _ d o #
@ -784,8 +695,7 @@ if __name__ == "__main__":
if any([arguments[i] for i in ["--irpf90",
"--ezfio_config",
"--ocaml",
"--ezfio_default",
"--global"]]):
"--ezfio_default"]]):
# User changer somme argument, do what he want
do_all = False
else:
@ -826,11 +736,60 @@ if __name__ == "__main__":
str_ezfio_default = create_ezfio_default(dict_ezfio_cfg)
save_ezfio_default(module_lower, str_ezfio_default)
# ~#~#~#~#~#~#~#~#~#~#~#~#~ #
# e z f i o _ d e f a u l t #
# ~#~#~#~#~#~#~#~#~#~#~#~#~ #
if do_all or arguments["--global"]:
str_ocaml_qp_edit, str_ocaml_input_auto = create_ocaml_input_global()
if __name__ == "__main__":
arguments = docopt(__doc__)
# ___
# | ._ o _|_
# _|_ | | | |_
#
if arguments["ocaml_global"]:
# ~#~#~#~# #
# I n i t #
# ~#~#~#~# #
l_module = get_l_module_with_auto_generate_ocaml_lower()
str_ocaml_qp_edit, str_ocaml_input_auto = create_ocaml_input_global(l_module)
save_ocaml_input_auto(str_ocaml_input_auto)
save_ocaml_qp_edit(str_ocaml_qp_edit)
sys.exit(0)
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~# #
# G e t _ m o d u l e _ d i r #
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~# #
if arguments["--path_module"]:
path_dirname = os.path.abspath(arguments["--path_module"])
else:
path_dirname = os.getcwd()
root_module = os.path.split(path_dirname)[1]
l_module = [root_module]
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# #
# G e t _ l _ d i c t _ e z f i o _ c f g #
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# #
qpackage_root_src = join(os.environ['QPACKAGE_ROOT'], "src")
l_module_with_ezfio = []
Module = namedtuple('Module', 'path lower')
for f in l_module:
path = join(qpackage_root_src, f, "EZFIO.cfg")
if exists(path):
l_module_with_ezfio.append(Module(path, f.lower()))
l_dict_ezfio_cfg = [(m, get_dict_config_file(m)) for m in l_module_with_ezfio]
# _
# / _ _| _ _ _ ._ _ ._ _. _|_ o _ ._
# \_ (_) (_| (/_ (_| (/_ | | (/_ | (_| |_ | (_) | |
# _|
for (m, dict_ezfio_cfg) in l_dict_ezfio_cfg:
code_generation(arguments, dict_ezfio_cfg, m)

View File

@ -348,6 +348,7 @@ class EZFIO_ocaml(object):
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~# #
# C r e a t e _ t e m pl a t e #
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~# #
l_template = ["(* Auto generate. Do not modify by Hand *)"]
l_template = ['open Qputils;;',
'open Qptypes;;',

View File

@ -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
done
# For old-style directories. Will be removed some day...
cp ${QPACKAGE_ROOT}/src{/*,}/*.ezfio_config ${QPACKAGE_ROOT}/EZFIO/config

View File

@ -1,156 +0,0 @@
#!/usr/bin/env python
__author__ = "Anthony Scemama"
__date__ = "Tue Jul 29 12:20:00 CEST 2014"
"""
Creates the provider of a variable that has to be
fetched from the EZFIO file.
"""
import sys
import os
class EZFIO_Provider(object):
data = """BEGIN_PROVIDER [ %(type)s, %(name)s ]
implicit none
BEGIN_DOC
! %(doc)s
END_DOC
logical :: has
PROVIDE ezfio_filename
call ezfio_has_%(ezfio_dir)s_%(ezfio_name)s(has)
if (has) then
call ezfio_get_%(ezfio_dir)s_%(ezfio_name)s(%(name)s)
else
%(default)s
endif
%(write)s
END_PROVIDER
"""
write_correspondance = {
"integer" : "write_int",
"logical" : "write_bool",
"double precision" : "write_double" }
def __init__(self):
self.values = "type doc default name ezfio_dir ezfio_name write output".split()
for v in self.values:
exec "self.%s = None"%(v) in locals()
def __repr__(self):
self.get_default()
self.set_write()
for v in self.values:
exec "test = self.%s is None"%(v) in locals()
if test:
print >>sys.stderr, "Error : %s is not set in ezfio_with_default.py"%(v)
for v in self.values:
exec "x = str(self.%s)"%(v) in locals()
print >>sys.stderr, "%s : %s"%(v, x)
sys.exit(1)
return self.data%self.__dict__
def set_write(self):
self.write = ""
if self.type in self.write_correspondance:
write = self.write_correspondance[self.type]
output = self.output
name = self.name
self.write = """
call write_time(%(output)s)
call %(write)s(%(output)s, %(name)s, &
'%(name)s')
"""%locals()
def set_type(self,t):
self.type = t.lower()
def set_doc(self,t):
self.doc = t.replace('\n', '\n! ')
def set_name(self,t):
self.name = t
def set_ezfio_dir(self,t):
self.ezfio_dir = t.lower()
def set_ezfio_name(self,t):
self.ezfio_name = t.lower()
def set_output(self,t):
self.output = t
def set_default(self,t):
self.default = t
def get_default(self):
mypath = '/'.join( [os.environ['QPACKAGE_ROOT'], 'data',
'ezfio_defaults'] )
from os import listdir
from os.path import isfile, join
onlyfiles = [ join(mypath,f) for f in listdir(mypath) if isfile(join(mypath,f)) ]
lines = []
for filename in onlyfiles:
file = open(filename,'r')
lines.extend(file.readlines())
file.close()
k=-1
# Search directory
for k,line in enumerate(lines):
if line[0] != ' ':
if line.strip().lower() == self.ezfio_dir:
break
if k+1 == len(lines):
return
# Search name
while k < len(lines):
k+=1
buffer = lines[k].split()
if len(buffer) == 0:
return
if buffer[0].lower() == self.ezfio_name:
break
v = buffer[1]
name = self.name
true = True
false= False
try:
true = True
false = False
v_eval = eval(v)
except:
v = "call ezfio_get_%(v)s(%(name)s)"%locals()
else:
if type(v_eval) == bool:
v = '.%s.'%(v)
elif type(v_eval) == float:
v = v.replace('e','d')
v = v.replace('E','D')
v = "%(name)s = %(v)s"%locals()
self.default = v
def test_module():
T = EZFIO_Provider()
T.set_type ( "double precision" )
T.set_name ( "thresh_SCF" )
T.set_doc ( "Threshold on the convergence of the Hartree Fock energy" )
T.set_ezfio_dir ( "Hartree_Fock" )
T.set_ezfio_name( "thresh_SCF" )
T.set_output ( "output_Hartree_Fock" )
print T
if __name__ == '__main__':
test_module()

View File

@ -1,73 +0,0 @@
#!/usr/bin/env python
import time
import os
import sys
"""Follow the output files in standard output"""
class OutputFollower(object):
def __init__(self,filename):
self.filename = filename
self.dir = filename+'/output/'
while not os.path.exists(self.dir):
time.sleep(.1)
self.last_time = {}
self.last_line = {}
self.data = {}
self.update_file_list()
self.running = False
def update_file_list(self):
self.file_list = filter(lambda x: x.endswith('.rst'), os.listdir(self.dir) )
for filename in self.file_list:
filename = self.dir+'/'+filename
statbuf = os.stat(filename)
date = statbuf.st_mtime
if filename not in self.last_time:
self.last_time[filename] = -1
self.last_line[filename] = -1
self.data[filename] = []
if date > self.last_time[filename]:
# Read file
file = open(filename,'r')
self.data[filename] = file.read().splitlines()
file.close()
# Print new lines
output = self.data[filename]
for line in output[self.last_line[filename]+1:]:
print line
self.last_time[filename] = date
self.last_line[filename] = len(output)-1
def start(self):
self.running = True
while self.running:
time.sleep(.1)
self.update_file_list()
def main():
F = OutputFollower(sys.argv[1])
# Handle signals
import signal
def handler(signum,frame):
if F.running:
F.running = False
else:
sys.exit(0)
for i in [2, 15]:
try:
signal.signal(i, handler)
except:
pass
F.start()
if __name__ == '__main__':
main()

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
import os
file = open(os.environ["QPACKAGE_ROOT"]+'/src/Determinants/H_apply_template.f','r')
file = open(os.environ["QPACKAGE_ROOT"]+'/src/Determinants/H_apply.template.f','r')
template = file.read()
file.close()

View File

@ -18,4 +18,4 @@ cd ${QPACKAGE_ROOT}
rm -f -- scripts/${DOCOPT}{,c}
${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${DOCOPT_URL} ${DOCOPT}
mv ${DOCOPT} scripts/${DOCOPT}
mv ${DOCOPT} scripts/utility/${DOCOPT}

View File

@ -20,7 +20,7 @@ cd ${QPACKAGE_ROOT}
${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/${BASE}.tar.gz
tar -zxf ${BASE}.tar.gz && rm ${BASE}.tar.gz ||exit 1
mv ${BASE}-master irpf90
make -C irpf90 | tee install_irpf90.log
make -C irpf90
rm -rf -- bin/irpf90 bin/irpman
echo '${QPACKAGE_ROOT}/irpf90/bin/irpf90 $@' > bin/irpf90
echo '${QPACKAGE_ROOT}/irpf90/bin/irpman $@' > bin/irpman

View File

@ -5,17 +5,19 @@
BASE="ninja"
URL="https://github.com/martine/ninja/archive/master.tar.gz"
if [[ -z ${QPACKAGE_ROOT} ]]
then
echo "The QPACKAGE_ROOT environment variable is not set."
echo "Please reload the quantum_package.rc file."
exit -1
fi
cd ${QPACKAGE_ROOT}
${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/${BASE}.tar.gz
tar -zxf ${BASE}.tar.gz && rm ${BASE}.tar.gz ||exit 1
rm -rf ${BASE}
mv ${BASE}-master ${BASE}
cd ${BASE}
./configure.py --bootstrap

View File

@ -17,7 +17,7 @@ cd ${QPACKAGE_ROOT}
rm -rf resultsFile-master
${QPACKAGE_ROOT}/scripts/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/resultsFile.tar.gz
${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/resultsFile.tar.gz
tar -zxf resultsFile.tar.gz && rm resultsFile.tar.gz ||exit 1
mv resultsFile-master resultsFile

View File

@ -28,7 +28,7 @@ then
fi
rm /tmp/main.c
${QPACKAGE_ROOT}/scripts/fetch_from_web.py ${ZLIB_URL} ZLIB.tar.gz
${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${ZLIB_URL} ZLIB.tar.gz
tar -zxf ZLIB.tar.gz && rm ZLIB.tar.gz ||exit 1
cd ${ZLIB} || exit 1
./configure && make

View File

@ -1,36 +0,0 @@
#!/bin/bash
#
# This script should run from the directory $QPACKAGE_ROOT/src
source ${QPACKAGE_ROOT}/scripts/run_Makefile_global.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}
${QPACKAGE_ROOT}/scripts/run_Makefile_common.sh
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
${QPACKAGE_ROOT}/scripts/module/create_gitignore.sh
cd ${OLDPWD}
done
${QPACKAGE_ROOT}/scripts/module/create_executables_list.sh

View File

@ -14,7 +14,7 @@ function do_clean()
{
rm -rf -- \
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
touch -c EZFIO.cfg *.ezfio_config

View File

@ -1,28 +0,0 @@
#!/bin/bash
#
# usage:
# create_Makefile.sh MOs AOs Electrons
# Creates the Makefile. This command is supposed to be run in a
# module directory.
# Thu Apr 3 01:44:41 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_module
cat << EOF > Makefile
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include \$(QPACKAGE_ROOT)/src/Makefile.common
EOF

View File

@ -1,46 +0,0 @@
#!/bin/bash
#
# This script is automatically invoked by Makefiles and should not be invoked
# by users.
# Creates the Makefile.depend file. This file contains all the external source
# files included by including other modules.
# Thu Apr 3 01:44:09 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_module
SRC=""
OBJ=""
DEPS="$NEEDED_MODULES"
for M in ${DEPS}
do
# X is the list of external source files
X=$(grep '^SRC=' "${QPACKAGE_ROOT}/src/${M}/Makefile" 2>/dev/null |cut -d '=' -f 2)
for f in ${X}
do
SRC+=" ${M}/${f}"
done
X=$(grep '^OBJ=' "${QPACKAGE_ROOT}/src/${M}/Makefile" 2>/dev/null |cut -d '=' -f 2)
for f in ${X}
do
OBJ+=" IRPF90_temp/${M}/${f/IRPF90_temp//}"
done
done
# Create the Makefile.depend
cat << EOF > Makefile.depend
# This file was created by the $0 script. Do not modify it by hand.
SRC+=${SRC}
OBJ+=${OBJ}
EOF

View File

@ -1,22 +0,0 @@
#!/bin/bash
#
# Creates the initial NEEDED_MODULES file.
# This script is supposed to run in a module directory.
# Thu Apr 3 13:38:38 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_module
OUTPUT=$(module_handler.py check_dependencies $@)
if [[ $? -eq 0 ]]
then
echo $@ > NEEDED_CHILDREN_MODULES
fi

View File

@ -8,10 +8,8 @@ then
print "Please reload the quantum_package.rc file."
exit -1
fi
source ${QPACKAGE_ROOT}/scripts/qp_include.sh
cd ${QPACKAGE_ROOT}/data
rm -f executables
EXES=$(find ${QPACKAGE_ROOT}/src -perm /u+x -type f | grep -e "${QPACKAGE_ROOT}/src/[^/]*/[^/]*$" |sort )

View File

@ -13,9 +13,10 @@ then
fi
source ${QPACKAGE_ROOT}/scripts/qp_include.sh
check_current_dir_is_module
cat << EOF > .gitignore
function do_gitingore()
{
cat << EOF > .gitignore
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
@ -26,13 +27,35 @@ irpf90.make
tags
Makefile.depend
irpf90_entities
.gitignore
build.ninja
.ninja_log
.ninja_deps
EOF
if [[ -f gitignore ]]
then
cat gitignore >> .gitignore
fi
find . -type l | sed "s@./@@" >> .gitignore
find . -type f -executable -print | sed "s@./@@" >> .gitignore
}
if [[ -f gitignore ]]
if [[ -z $1 ]]
then
cat gitignore >> .gitignore
check_current_dir_is_module
do_gitingore
else
check_current_dir_is_src
for i in $@
do
if [[ -d $i ]]
then
cd $i
do_gitingore
cd $OLDPWD
fi
done
fi
find . -type l | sed "s@./@@" >> .gitignore
find . -type f -executable -print | sed "s@./@@" >> .gitignore

View File

@ -1,43 +0,0 @@
#!/bin/bash
#
# Creates the rst files when creating a new module.
# Thu Apr 3 11:54:16 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_module
MODULE=$(basename $PWD)
README="True"
if [[ -f README.rst ]]
then
asksure "Overwrite existing README.rst file?" || README="False"
fi
UNDERLINE="======="
declare -i i=0
while [[ i -lt ${#MODULE} ]]
do
UNDERLINE+="="
i+=1
done
if [[ ${README} == "True" ]]
then
cat << EOF > ./README.rst
$UNDERLINE
$MODULE Module
$UNDERLINE
EOF
fi
touch ./ASSUMPTIONS.rst

View File

@ -1,34 +1,35 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Create the NEEDED_MODULE
aka the genealogy (children module, subchildren module and so on),
of a NEEDED_CHILDREN_MODULES file
Usage:
module_handler.py print_genealogy [<NEEDED_CHILDREN_MODULES>]
module_handler.py check_dependencies [<module_name>...]
module_handler.py create_png [<NEEDED_CHILDREN_MODULES>]
module_handler.py print_descendant [<NEEDED_CHILDREN_MODULES>]
module_handler.py create_png [<NEEDED_CHILDREN_MODULES>]
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)
create_png Create a png of the file
NEEDED_CHILDREN_MODULES The path of NEEDED_CHILDREN_MODULES
by default try to open the file in the current path
"""
from docopt import docopt
import os
import sys
import os.path
from qp_utils import cache
try:
from docopt import docopt
from decorator import classproperty
except ImportError:
print "source .quantum_package.rc"
raise
@cache
def get_dict_genealogy():
# Canot cache for namedtuple are not hashable
def get_dict_child():
"""Loop over MODULE in QPACKAGE_ROOT/src, open all the NEEDED_CHILDREN_MODULES
and create a dict[MODULE] = [sub module needed, ...]
"""
@ -40,7 +41,8 @@ def get_dict_genealogy():
for o in os.listdir(dir_):
try:
with open(os.path.join(dir_, o, "NEEDED_CHILDREN_MODULES"), "r") as f:
path_file = os.path.join(dir_, o, "NEEDED_CHILDREN_MODULES")
with open(path_file, "r") as f:
l_children = f.read().split()
except IOError:
pass
@ -50,120 +52,136 @@ def get_dict_genealogy():
return d_ref
def module_genealogy(path):
"""
Take a name of a NEEDED_CHILDREN_MODULES
and return a list of all the {sub, subsub, ...}children
"""
try:
with open(path, "r") as f:
l_children = f.read().split()
except IOError as e:
print >> sys.stderr, e
sys.exit(1)
else:
needed_module = get_it_and_children(l_children)
return needed_module
def get_it_and_children(l_module):
def l_module_generalogy_rec(d_chidlren, l_module):
"""
From a list of module return the module and all of the genealogy
"""
d_ref = get_dict_genealogy()
l = []
for module in l_module:
if module not in l:
l.append(module)
try:
l.extend(get_it_and_children(d_ref[module]))
l.extend(l_module_generalogy_rec(d_chidlren, d_chidlren[module]))
except KeyError:
print >> sys.stderr, "`{0}` in not a good submodule name".format(module)
print >> sys.stderr, "`{0}` not submodule".format(module)
print >> sys.stderr, "Check the corresponding NEEDED_CHILDREN_MODULES"
sys.exit(1)
return list(set(l))
def get_all_children(l_module):
"""
From a list of module return all the genealogy
"""
class ModuleHandler:
it_and_all = get_it_and_children(l_module)
return [children for children in it_and_all if children not in l_module]
dict_child = get_dict_child()
@classproperty
def l_module(self):
return self.dict_child.keys()
def reduce_(l_module):
"""
Take a l_module and try to find the lower combinaitions
of module with the same genealogy
"""
import itertools
d_ref = get_dict_genealogy()
@classproperty
def dict_parent(self):
"""
Get a dic of the first parent
"""
d_child = self.dict_child
target_genealogy = sorted(get_all_children(l_module))
d = {}
for i in xrange(len(d_ref)):
for c in itertools.combinations(d_ref, i):
for module_name in d_child:
d[module_name] = [i for i in d_child.keys() if module_name in d_child[i]]
guess_genealogy = sorted(get_it_and_children(d_ref, c))
return d
if target_genealogy == guess_genealogy:
return c
@classproperty
def dict_descendant(self):
"""
Get a dic of all the genealogy desc (children and all_children)
"""
d = {}
d_child = self.dict_child
def create_png_from_path(path):
" Change a path like this into a module list"
"path = /home/razoa/quantum_package/src/Molden/NEEDED_CHILDREN_MODULES"
for module_name in d_child:
d[module_name] = l_module_generalogy_rec(d_child,
d_child[module_name])
l_module = os.path.split(path)[0].split("/")[-1]
return d
import pydot
try:
create_png([l_module])
except pydot.InvocationException:
pass
@classproperty
def dict_root(self):
"""
Return a dict(module_name) = module_boss
The top node in a tree.
"""
d_asc = self.dict_parent
d_desc = self.dict_descendant
l_all_module = self.l_module
def create_png(l_module):
"""Create the png of the dependancy tree for a l_module"""
dict_root = {}
# Init
import pydot
all_ready_done = []
for module in l_all_module:
dict_root[module] = [ p for p in l_all_module if module in [p] + d_desc[p] and not d_asc[p]][0]
def draw_module_edge(module, l_children):
"Draw all the module recursifly"
return dict_root
if module not in all_ready_done:
for children in l_children:
# Add Edge
edge = pydot.Edge(module, children)
graph.add_edge(edge)
# Recurs
draw_module_edge(children, d_ref[children])
all_ready_done.append(module)
@classmethod
def l_descendant_unique(cls, l_module):
d_desc = cls.dict_descendant
# Init
graph = pydot.Dot(graph_type='digraph')
d_ref = get_dict_genealogy()
d = {}
for module in l_module:
for e in d_desc[module]:
d[e] = 1
# Create all the edge
for module in l_module:
node_a = pydot.Node(module, fontcolor="red")
graph.add_node(node_a)
draw_module_edge(module, d_ref[module])
return d.keys()
# Save
path = '{0}.png'.format("tree_dependancy")
# path = '{0}.png'.format("_".join(l_module))
# print "png saved in {0}".format(path)
@classmethod
def l_reduce_tree(cls, l_module):
"""For a list of module in input return only the root"""
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)
return l_module_reduce
@classmethod
def create_png(cls, l_module):
"""Create the png of the dependency tree for a l_module"""
# Init
import pydot
all_ready_done = []
def draw_module_edge(module, l_children):
"Draw all the module recursifly"
if module not in all_ready_done:
for children in l_children:
# Add Edge
edge = pydot.Edge(module, children)
graph.add_edge(edge)
# Recurs
draw_module_edge(children, d_ref[children])
all_ready_done.append(module)
# Init
graph = pydot.Dot(graph_type='digraph')
d_ref = cls.dict_child
# Create all the edge
for module in l_module:
node_a = pydot.Node(module, fontcolor="red")
graph.add_node(node_a)
draw_module_edge(module, d_ref[module])
# Save
path = '{0}.png'.format("tree_dependency")
graph.write_png(path)
graph.write_png(path)
if __name__ == '__main__':
@ -171,22 +189,16 @@ if __name__ == '__main__':
if not arguments['<NEEDED_CHILDREN_MODULES>']:
dir_ = os.getcwd()
path = os.path.join(dir_, "NEEDED_CHILDREN_MODULES")
else:
path = os.path.abspath(arguments['<NEEDED_CHILDREN_MODULES>'])
path = os.path.expanduser(path)
path = os.path.expandvars(path)
path_file = os.path.abspath(arguments['<NEEDED_CHILDREN_MODULES>'])
path_file = os.path.expanduser(path_file)
path_file = os.path.expandvars(path_file)
dir_ = os.path.dirname(path_file)
if arguments['print_genealogy']:
l_all_needed_molule = module_genealogy(path)
print " ".join(sorted(l_all_needed_molule))
path_file = os.path.basename(dir_)
elif arguments["check_dependencies"]:
l_module = arguments['<module_name>']
if l_module:
l_all_needed_molule = get_it_and_children(l_module)
else:
l_all_needed_molule = module_genealogy(path)
if arguments['print_descendant']:
print " ".join(sorted(ModuleHandler.l_module))
elif arguments["create_png"]:
create_png_from_path(path)
if arguments["create_png"]:
ModuleHandler.create_png([path_file])

View File

@ -1,146 +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
"${QPACKAGE_ROOT}/scripts/module/create_Needed_modules.sh" ${NEEDED_MODULES} || fail "Unable to create the NEEDED_MODULES file"
if [[ ! -f NEEDED_CHILDREN_MODULES ]]
then
fail "NEEDED_MODULES was not created"
fi
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"

View File

@ -0,0 +1,86 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage: qp_install_module.py list
qp_install_module.py create -n <name> [<children_module>...]
Options:
list: List all the module avalaible
create: Create a new 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)

160
scripts/module/update_README.py Executable file
View File

@ -0,0 +1,160 @@
#!/usr/bin/env python
"""Updates the README.rst file as the include directive is disabled on GitHub."""
__date__ = "Thu Apr 3 23:06:18 CEST 2014"
__author__ = "Anthony Scemama<scemama@irsamc.ups-tlse.fr> & TApplencourt "
README = "README.rst"
Assum_key = "Assumptions\n===========\n"
Needed_key = "Needed Modules\n==============\n"
Doc_key = "Documentation\n=============\n"
Sentinel = "@@$%&@@"
URL = "http://github.com/LCPQ/quantum_package/tree/master/src/"
import os
import subprocess
from collections import namedtuple
header = """
.. Do not edit this section. It was auto-generated from the
.. by the `update_README.py` script.
"""
def fetch_splitted_data():
"""Read the README.rst file and split it in strings:
* The documentation
* The needed modules
The result is given as a list of strings
"""
with open(README, 'r') as f:
data = f.read()
# Place sentinels
data = data.replace(Doc_key, Sentinel + Doc_key)
data = data.replace(Needed_key, Sentinel + Needed_key)
# Now Split data using the sentinels
result = data.split(Sentinel)
return result
def update_needed(data):
"""Read the NEEDED_CHILDREN_MODULES file, and replace the data with it.
Create the links to the GitHub pages."""
with open('NEEDED_CHILDREN_MODULES', 'r') as f:
modules = f.read()
header_image = ".. image:: tree_dependency.png\n\n"
if modules.strip():
modules = ['* `{0} <{1}>`_'.format(name, os.path.join(URL, name))
for name in modules.split()]
modules = "\n".join(modules)
modules = Needed_key + header + header_image + modules + '\n\n'
has_modules = False
for i in range(len(data)):
if data[i].startswith(Needed_key):
has_modules = True
data[i] = modules
if not has_modules:
data.append(modules)
return data
def extract_doc(item):
"""Extracts the documentation contained in IRPF90_man file"""
with open("IRPF90_man/%s.l" % (item), 'r') as f:
l_line = f.readlines()
result = []
inside = False
for line in l_line:
if not inside:
inside = line.startswith(".SH Description")
else:
if line.startswith(".SH"):
break
result.append(" {0}".format(line.strip()))
if not result:
result = [" Undocumented"]
return "\n".join(result) + '\n'
def update_documentation(data):
"""Reads the BEGIN_DOC ... END_DOC blocks and builds the documentation"""
IRP_info = namedtuple('IRP_info', ["name", "file", "line"])
# If the file does not exist, don't do anything
with open('tags', 'r') as f:
l_info = [IRP_info(*i.split()) for i in f.readlines()
if "/" not in i.split()[1]]
l_line = []
module_name = os.path.basename(os.getcwd())
for irp in l_info:
url = os.path.join(URL, module_name, irp.file)
doc = extract_doc(irp.name)
l_line += ["`{0} <{1}#L{2}>`_".format(irp.name, url, irp.line), doc,
""]
documentation = Doc_key + header + "\n".join(l_line)
has_doc = False
for i in range(len(data)):
if data[i].startswith(Doc_key):
has_doc = True
data[i] = documentation
if not has_doc:
data.append(documentation)
return data
def git_add():
"""Executes:
git add README.rst
throw an error if git is not precent"""
try:
# pipe output to /dev/null for silence
null = open("/dev/null", "w")
subprocess.Popen("git add README.rst", stdout=null, stderr=null)
null.close()
except OSError:
raise
def main():
data = fetch_splitted_data()
data = update_documentation(data)
data = update_needed(data)
output = ''.join(data)
with open(README, 'w') as f:
f.write(output)
try:
git_add()
except OSError:
pass
if __name__ == '__main__':
main()

View File

@ -24,23 +24,20 @@ function check_current_dir_is_src()
function check_current_dir_is_module()
{
cd ..
if [[ "${PWD}" == "${QPACKAGE_ROOT}/src" ]]
# If the prefix ${QPACKAGE_ROOT}/src/ can be removed from $PWD, it means that
# $PWD is somewhere below ${QPACKAGE_ROOT}/src/ so it is a module.
# If the prefix ${QPACKAGE_ROOT}/src/ can not be removed from $PWD, then
# "${PWD##${QPACKAGE_ROOT}/src/}" == "$PWD".
if [[ "${PWD##${QPACKAGE_ROOT}/src/}" != "$PWD" ]]
then
cd $OLDPWD
return 0
else
cd $OLDPWD
echo "Current directory should be \$QPACKAGE_ROOT/src"
echo "You are not in a submodule"
exit -1
fi
}
if [[ -f NEEDED_CHILDREN_MODULES ]]
then
NEEDED_MODULES=$(module_handler.py print_genealogy NEEDED_CHILDREN_MODULES)
fi
# List of executables in the current directory
function ls_exe()
{

View File

@ -1,71 +0,0 @@
#!/bin/bash
#
# Checks to run in every Module directory before building
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_module
# Check if the NEEDED_MODULES file is consistent
INCLUDE_DIRS="${NEEDED_MODULES} include"
NEEDED_MODULES_OK=$(module_handler.py check_dependencies ${NEEDED_MODULES} )
if [[ $? -ne 0 ]]
then
error "
Your NEEDED_MODULES file is inconsistent. It should be
${NEEDED_MODULES_OK}
"
else
info "NEEDED_MODULES files is consistent"
fi
# Check if README.rst exists
if [[ ! -f README.rst ]]
then
${QPACKAGE_ROOT}/scripts/module/create_rst_templates.sh
error "
README.rst was not present, so I created a
default one for you.
You should document it before you compile, as
well as the ASSUMPTIONS.rst file.
"
else
info "README.rst is present"
fi
# Check if ASSUMPTIONS.rst exists
if [[ ! -f ASSUMPTIONS.rst ]]
then
error "This is a Bug. At that point, the ASSUMPTIONS.rst) file should exist."
else
info "ASSUMPTIONS.rst is present."
fi
# Create symbolic links of other modules
if [[ $PWD != ${QPACKAGE_ROOT}/src ]]
then
for dir in ${INCLUDE_DIRS}
do
if [[ ! -h $dir ]] ;
then
ln -s ../$dir $dir
fi
done
fi
# Update Makefile.depend
${QPACKAGE_ROOT}/scripts/module/create_Makefile_depend.sh
# Update EZFIO interface
${QPACKAGE_ROOT}/scripts/ezfio_interface/ei_handler.py
# Create png
${QPACKAGE_ROOT}/scripts/module/module_handler.py create_png

View File

@ -1,83 +0,0 @@
#!/bin/bash
# Makes several checks before compiling.
# Wed Mar 25 21:22:18 CET 2015
# Required EZFIO version
EZFIO_REQUIRED_VERSION=1.1
# Required IRPF90 version
IRPF90_REQUIRED_VERSION=1.5
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
IRPF90="${QPACKAGE_ROOT}/bin/irpf90 ${IRPF90_FLAGS}"
# Check if the user's config exists
if [[ ! -f ${QPACKAGE_ROOT}/src/Makefile.config ]]
then
error "
Makefile.config is not present.
You can create Makefile.config
by modifying Makefile.config.example
"
else
info "Makefile.config is present"
fi
IRPF90_VERSION=$( ${IRPF90} -v )
python << EOF
import sys
irp_version = float("${IRPF90_VERSION}".rsplit('.',1)[0])
irp_required_version = float($IRPF90_REQUIRED_VERSION)
if irp_version < irp_required_version:
sys.exit(-1)
EOF
if [[ $? -ne 0 ]]
then
error "
Current IRPF90 version :
\$ ${IRPF90} -v
${IRPF90_VERSION}.
IRPF90 version >= ${IRPF90_REQUIRED_VERSION} is required.
To upgrade IRPF90, run :
${QPACKAGE_ROOT}/scripts/upgrade/upgrade_irpf90.sh
"
else
info "irpf90 version is OK"
fi
# Check EZFIO version
EZFIO_VERSION=$(cat ${QPACKAGE_ROOT}/EZFIO/version | cut -d '=' -f 2)
python << EOF
import sys
ezfio_version = float("${EZFIO_VERSION}".rsplit('.',1)[0])
ezfio_required_version = float($EZFIO_REQUIRED_VERSION)
if ezfio_version < ezfio_required_version:
sys.exit(-1)
EOF
if [[ $? -ne 0 ]]
then
error "
Current EZFIO version : ${EZFIO_VERSION}
EZFIO version >= ${EZFIO_REQUIRED_VERSION} is required.
To upgrade EZFIO, run :
${QPACKAGE_ROOT}/scripts/upgrade/upgrade_ezfio.sh
"
else
info "EZFIO version is OK"
fi

View File

@ -1,93 +0,0 @@
#!/usr/bin/python
import sys,os
import subprocess
DEBUG=False
def run_test(test_name,inp):
command = './'+test_name+" ${QPACKAGE_ROOT}/data/inputs/"+inp
try:
result = subprocess.check_output(command, shell=True)
except:
result = sys.exc_info()[0]
return result
if __name__ == '__main__':
import unittest
from math import *
from multiprocessing import Pool
env = os.environ
verbosity = 1
if os.environ["OMP_NUM_THREADS"]=="1":
try:
nproc = int(subprocess.check_output("cat /proc/cpuinfo | grep processor | wc -l", shell=True))
except:
nproc=4
else:
nproc=1
testfiles = []
for f in os.listdir(os.getcwd()):
if f.endswith('.irp.f'):
testfiles.append(f.replace('.irp.f',''))
# start worker processes
pool = Pool(processes=nproc)
template = """
class $test(unittest.TestCase):
default_precision = 10
execfile('$test.ref')
name = '$test'
tasks = {}
def setUp(self):
if DEBUG: return
for d in self.data.keys():
if d not in self.tasks:
self.tasks[d] = pool.apply_async(run_test, [self.name, d])
def _test_input(self,inp):
if DEBUG:
output = run_test(self.name,inp)
else:
output = self.tasks[inp].get()
for line in output.splitlines():
buffer = line.split(':')
if len(buffer) == 1:
continue
l,r = buffer
l,r = l.strip(), eval(r)
if 'precision' in self.__dict__:
precision = self.precision[l]
else:
precision = self.default_precision
if type(r) == float:
self.assertAlmostEqual(self.data[inp][l], r,
places=precision, msg=None)
#places=abs(int(log10(precision*max(abs(self.data[inp][l]),1.e-12)))), msg=None)
else:
self.assertEqual(self.data[inp][l], r, msg=None)
t = "def test_$k(self): self._test_input('$i')"
for i in data.keys():
k = i
k = k.replace('.ezfio','')
k = k.replace('-','_m_')
k = k.replace('+','_p_')
exec t.replace('$i',i).replace('$k',k) in locals()
"""
for test in testfiles:
exec template.replace('$test',test) in locals()
unittest.main(verbosity=verbosity)

View File

@ -1,214 +0,0 @@
#!/usr/bin/env python
"""Updates the README.rst file as the include directive is disabled on GitHub."""
__date__ = "Thu Apr 3 23:06:18 CEST 2014"
__author__ = "Anthony Scemama<scemama@irsamc.ups-tlse.fr> & TApplencourt "
README = "README.rst"
Assum_key = "Assumptions\n===========\n"
Needed_key = "Needed Modules\n==============\n"
Doc_key = "Documentation\n=============\n"
Sentinel = "@@$%&@@"
URL = "http://github.com/LCPQ/quantum_package/tree/master/src/"
import os
import subprocess
header = """
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
"""
def fetch_splitted_data():
"""Read the README.rst file and split it in strings:
* The description
* The assumptions
* The documentation
* The needed modules
The result is given as a list of strings
"""
file = open(README, 'r')
data = file.read()
file.close()
# Place sentinels
data = data.replace(Assum_key, Sentinel + Assum_key)
data = data.replace(Doc_key, Sentinel + Doc_key)
data = data.replace(Needed_key, Sentinel + Needed_key)
# Now Split data using the sentinels
result = data.split(Sentinel)
return result
def update_assumptions(data):
"""Read the ASSUMPTIONS.rst file, and replace the data with it."""
try:
file = open('ASSUMPTIONS.rst', 'r')
except IOError:
file = open('ASSUMPTIONS.rst', 'w')
assumptions = ""
else:
assumptions = file.read()
file.close()
if assumptions.strip() != "":
assumptions = Assum_key + header + assumptions + '\n\n'
has_assumptions = False
for i in range(len(data)):
if data[i].startswith(Assum_key):
has_assumptions = True
data[i] = assumptions
if not has_assumptions:
data.insert(1, assumptions)
return data
def update_needed(data):
"""Read the NEEDED_MODULES file, and replace the data with it.
Create the links to the GitHub pages."""
file = open('NEEDED_CHILDREN_MODULES', 'r')
modules = file.read()
file.close()
header_image = ".. image:: tree_dependancy.png\n\n"
if modules.strip() != "":
modules = ['* `%s <%s%s>`_' % (x, URL, x) for x in modules.split()]
modules = "\n".join(modules)
modules = Needed_key + header + header_image + modules + '\n\n'
has_modules = False
for i in range(len(data)):
if data[i].startswith(Needed_key):
has_modules = True
data[i] = modules
if not has_modules:
data.append(modules)
return data
def update_documentation(data):
"""Reads the BEGIN_DOC ... END_DOC blocks and builds the documentation"""
# If the file does not exist, don't do anything
try:
file = open('tags', 'r')
except:
return
tags = file.readlines()
file.close()
def extract_doc(item):
"""Extracts the documentation contained in IRPF90_man file"""
file = open("IRPF90_man/%s.l" % (item), 'r')
lines = file.readlines()
file.close()
result = []
inside = False
for line in lines:
if not inside:
inside = line.startswith(".SH Description")
else:
if line.startswith(".SH"):
break
result.append(" " + line.strip())
if result == []:
result = [" Undocumented"]
return "\n".join(result) + '\n'
items = []
dirname = os.path.basename(os.getcwd())
command = "git ls-tree --full-tree --name-only HEAD:src/%s"
command = command % (dirname)
try:
if dirname != 'src':
p = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
tracked_files = p.stdout.read()
else:
tracked_files = ""
tracked_files = tracked_files.splitlines()
except:
tracked_files = []
for filename in tracked_files:
if filename.endswith('.irp.f'):
# Search for providers, subroutines and functions in each file using
# the tags file
search = "\t" + filename + "\t"
tmp = filter(lambda line: search in line, tags)
# Search for the documentation in the IRPF90_man directory
for item in tmp:
item, _, line = item.strip().split('\t')
doc = extract_doc(item)
items.append((item, filename, doc, line))
dirname = os.path.basename(os.getcwd())
# Write the documentation in the README
template = "`%(item)s <%(url)s%(dirname)s/%(filename)s#L%(line)s>`_\n%(doc)s\n"
documentation = Doc_key + header
url = URL
for item, filename, doc, line in items:
documentation += template % locals()
documentation += '\n\n'
has_doc = False
for i in range(len(data)):
if data[i].startswith(Doc_key):
has_doc = True
data[i] = documentation
if not has_doc:
data.append(documentation)
return data
def git_add():
"""Executes:
git add README.rst
throw an error if git is not precent"""
import subprocess
try:
# pipe output to /dev/null for silence
null = open("/dev/null", "w")
subprocess.Popen("git add README.rst", stdout=null, stderr=null)
null.close()
except OSError:
raise
def main():
data = fetch_splitted_data()
data = update_assumptions(data)
data = update_documentation(data)
data = update_needed(data)
output = ''.join(data)
with open(README, 'w') as f:
f.write(output)
try:
git_add()
except OSError:
pass
if __name__ == '__main__':
main()

View File

@ -15,3 +15,12 @@ def cache(func):
saved[args] = result
return result
return newfunc
class classproperty(object):
def __init__(self, fget):
self.fget = fget
def __get__(self, owner_self, owner_cls):
return self.fget(owner_cls)

View File

@ -23,6 +23,7 @@ export PYTHONPATH=\${PYTHONPATH}\$(find "\${QPACKAGE_ROOT}"/scripts -type d -pri
export PATH=\${PATH}\$(find "\${QPACKAGE_ROOT}"/scripts -type d -printf ":%p")
export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/bin
export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/ocaml
export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/ninja
source "\${QPACKAGE_ROOT}"/bin/irpman &> /dev/null
EOF
@ -39,6 +40,9 @@ fi
mkdir -p ${QPACKAGE_ROOT}/install_logs
echo "${BLUE}===== Installing Ninja ===== ${BLACK}"
${QPACKAGE_ROOT}/scripts/install/install_ninja.sh | tee ${QPACKAGE_ROOT}/install_logs/install_ninja.log
echo "${BLUE}===== Installing Zlib ===== ${BLACK}"
${QPACKAGE_ROOT}/scripts/install/install_zlib.sh | tee ${QPACKAGE_ROOT}/install_logs/install_zlib.log

13
src/AOs/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps

View File

@ -1 +0,0 @@
* The AO coefficients in the EZFIO files are not necessarily normalized and are normalized after reading

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -1 +1 @@
Nuclei Utils
Nuclei

View File

@ -27,9 +27,6 @@ the two electron integrals.
Assumptions
===========
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
* The AO coefficients in the EZFIO files are not necessarily normalized and are normalized after reading
@ -37,121 +34,148 @@ Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
.. image:: tree_dependancy.png
.. image:: tree_dependency.png
* `Nuclei <http://github.com/LCPQ/quantum_package/tree/master/src/Nuclei>`_
* `Utils <http://github.com/LCPQ/quantum_package/tree/master/src/Utils>`_
Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
`ao_overlap <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L1>`_
Overlap between atomic basis functions:
:math:`\int \chi_i(r) \chi_j(r) dr)`
`ao_overlap_abs <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L65>`_
Overlap between absolute value of atomic basis functions:
:math:`\int |\chi_i(r)| |\chi_j(r)| dr)`
`ao_overlap_x <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L2>`_
Overlap between atomic basis functions:
:math:`\int \chi_i(r) \chi_j(r) dr)`
`ao_overlap_y <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L3>`_
Overlap between atomic basis functions:
:math:`\int \chi_i(r) \chi_j(r) dr)`
`ao_overlap_z <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L4>`_
Overlap between atomic basis functions:
:math:`\int \chi_i(r) \chi_j(r) dr)`
.. by the `update_README.py` script.
`ao_coef <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L62>`_
AO Coefficients, read from input. Those should not be used directly, as
the MOs are expressed on the basis of **normalized** AOs.
`ao_coef_normalized <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L84>`_
Coefficients including the AO normalization
`ao_coef_normalized_ordered <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L107>`_
Sorted primitives to accelerate 4 index MO transformation
`ao_coef_normalized_ordered_transp <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L133>`_
Transposed ao_coef_normalized_ordered
`ao_expo <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L41>`_
AO Exponents read from input
`ao_expo_ordered <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L108>`_
Sorted primitives to accelerate 4 index MO transformation
`ao_expo_ordered_transp <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L147>`_
Transposed ao_expo_ordered
`ao_l <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L162>`_
ao_l = l value of the AO: a+b+c in x^a y^b z^c
`ao_l_char <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L163>`_
ao_l = l value of the AO: a+b+c in x^a y^b z^c
`ao_l_char_space <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L311>`_
Undocumented
`ao_md5 <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L403>`_
MD5 key characteristic of the AO basis
`ao_nucl <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L209>`_
Index of the nuclei on which the ao is centered
`ao_num <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L1>`_
Number of atomic orbitals
`ao_num_align <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L2>`_
Number of atomic orbitals
`ao_overlap <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L1>`_
Overlap between atomic basis functions:
:math:`\int \chi_i(r) \chi_j(r) dr)`
`ao_overlap_abs <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L65>`_
Overlap between absolute value of atomic basis functions:
:math:`\int |\chi_i(r)| |\chi_j(r)| dr)`
`ao_overlap_x <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L2>`_
Overlap between atomic basis functions:
:math:`\int \chi_i(r) \chi_j(r) dr)`
`ao_overlap_y <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L3>`_
Overlap between atomic basis functions:
:math:`\int \chi_i(r) \chi_j(r) dr)`
`ao_overlap_z <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/ao_overlap.irp.f#L4>`_
Overlap between atomic basis functions:
:math:`\int \chi_i(r) \chi_j(r) dr)`
`ao_power <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L19>`_
Powers of x,y and z read from input
`ao_prim_num <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L177>`_
Number of primitives per atomic orbital
`ao_prim_num_max <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L199>`_
Undocumented
`ao_prim_num_max_align <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L200>`_
Undocumented
`l_to_charater <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L218>`_
character corresponding to the "L" value of an AO orbital
`n_aos_max <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L231>`_
Number of AOs per atom
`n_pt_max_i_x <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/dimensions_integrals.irp.f#L2>`_
Undocumented
`n_pt_max_integrals <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/dimensions_integrals.irp.f#L1>`_
Undocumented
`nucl_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L244>`_
List of AOs attached on each atom
`nucl_list_shell_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L262>`_
Index of the shell type Aos and of the corresponding Aos
Per convention, for P,D,F and G AOs, we take the index
of the AO with the the corresponding power in the "X" axis
`nucl_n_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L230>`_
Number of AOs per atom
`nucl_num_shell_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/aos.irp.f#L263>`_
Index of the shell type Aos and of the corresponding Aos
Per convention, for P,D,F and G AOs, we take the index
of the AO with the the corresponding power in the "X" axis
`n_pt_max_i_x <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/dimensions_integrals.irp.f#L2>`_
Undocumented
`n_pt_max_integrals <http://github.com/LCPQ/quantum_package/tree/master/src/AOs/dimensions_integrals.irp.f#L1>`_
Undocumented

View File

@ -3,13 +3,13 @@
implicit none
integer :: n_pt_sup
integer :: prim_power_l_max
include 'include/constants.F'
include 'Utils/constants.include.F'
prim_power_l_max = maxval(ao_power)
n_pt_max_integrals = 24 * prim_power_l_max + 4
n_pt_max_i_x = 8 * prim_power_l_max
ASSERT (n_pt_max_i_x-1 <= max_dim)
if (n_pt_max_i_x-1 > max_dim) then
print *, 'Increase max_dim in 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
endif
END_PROVIDER

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
src/AOs/tree_dependency.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

13
src/Bitmask/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps

View File

@ -1,8 +0,0 @@
``bit_kind_shift``, ``bit_kind_size`` and ``bit_kind`` are coherent:
.. code_block:: fortran
2**bit_kind_shift = bit_kind_size
bit_kind = bit_kind_size / 8

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=bitmasks_module.f90
OBJ=IRPF90_temp/bitmasks_module.o
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -22,7 +22,7 @@ Assumptions
===========
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. NEEDED_MODULES_CHILDREN file by the `update_README.py` script.
``bit_kind_shift``, ``bit_kind_size`` and ``bit_kind`` are coherent:
@ -38,9 +38,9 @@ Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
.. image:: tree_dependancy.png
.. image:: tree_dependency.png
* `MOs <http://github.com/LCPQ/quantum_package/tree/master/src/MOs>`_
@ -48,32 +48,42 @@ Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
`is_a_two_holes_two_particles <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L206>`_
Undocumented
`bitstring_to_hexa <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L98>`_
Transform a bit string to a string in hexadecimal format for printing
`number_of_holes <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L1>`_
Undocumented
`number_of_holes_verbose <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L394>`_
Undocumented
`bitstring_to_list <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L1>`_
Gives the inidices(+1) of the bits set to 1 in the bit string
`number_of_particles <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L103>`_
Undocumented
`number_of_particles_verbose <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L422>`_
Undocumented
`bitstring_to_str <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L65>`_
Transform a bit string to a string for printing
`cas_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L173>`_
Bitmasks for CAS reference determinants. (N_int, alpha/beta, CAS reference)
`cis_ijkl_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L32>`_
Bitmask to include all possible single excitations from Hartree-Fock
`debug_det <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L120>`_
Subroutine to print the content of a determinant in '+-' notation and
hexadecimal representation.
`debug_spindet <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L155>`_
Subroutine to print the content of a determinant in '+-' notation and
hexadecimal representation.
`full_ijkl_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L12>`_
Bitmask to include all possible MOs
`generators_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L100>`_
Bitmasks for generator determinants.
(N_int, alpha/beta, hole/particle, generator).
@ -93,56 +103,68 @@ Documentation
* 6 : particle for 2nd exc of double
.br
`hf_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L44>`_
Hartree Fock bit mask
`i_bitmask_gen <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L211>`_
Current bitmask for the generators
`inact_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L193>`_
Bitmasks for the inactive orbitals that are excited in post CAS method
`n_cas_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L143>`_
Number of bitmasks for CAS
`n_generators_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L70>`_
Number of bitmasks for generators
`is_a_two_holes_two_particles <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L206>`_
Undocumented
`n_int <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L3>`_
Number of 64-bit integers needed to represent determinants as binary strings
`ref_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L62>`_
Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask
`virt_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L194>`_
Bitmasks for the inactive orbitals that are excited in post CAS method
`bitstring_to_hexa <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L98>`_
Transform a bit string to a string in hexadecimal format for printing
`bitstring_to_list <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L1>`_
Gives the inidices(+1) of the bits set to 1 in the bit string
`bitstring_to_str <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L65>`_
Transform a bit string to a string for printing
`debug_det <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L120>`_
Subroutine to print the content of a determinant in '+-' notation and
hexadecimal representation.
`debug_spindet <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L155>`_
Subroutine to print the content of a determinant in '+-' notation and
hexadecimal representation.
`list_to_bitstring <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L29>`_
Returns the physical string "string(N_int,2)" from the array of
occupations "list(N_int*bit_kind_size,2)
`n_cas_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L143>`_
Number of bitmasks for CAS
`n_generators_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L70>`_
Number of bitmasks for generators
`n_int <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L3>`_
Number of 64-bit integers needed to represent determinants as binary strings
`number_of_holes <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L1>`_
Undocumented
`number_of_holes_verbose <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L394>`_
Undocumented
`number_of_particles <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L103>`_
Undocumented
`number_of_particles_verbose <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmask_cas_routines.irp.f#L422>`_
Undocumented
`print_det <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L138>`_
Subroutine to print the content of a determinant using the '+-' notation
`print_spindet <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L171>`_
Subroutine to print the content of a determinant using the '+-' notation
`ref_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L62>`_
Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask
`virt_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L194>`_
Bitmasks for the inactive orbitals that are excited in post CAS method

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

32
src/CAS_SD/.gitignore vendored Normal file
View File

@ -0,0 +1,32 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps
Pseudo
Integrals_Monoelec
Generators_CAS
Bitmask
Integrals_Bielec
AOs
Selectors_full
MOs
Hartree_Fock
Perturbation
Determinants
Electrons
Utils
Properties
Nuclei
MOGuess
Ezfio_files
cas_sd_selected
cas_sd

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -11,20 +11,69 @@ Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
`full_ci <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/cas_sd_selected.irp.f#L1>`_
Undocumented
`h_apply_cas_sd <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L406>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cas_sd_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L1>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cas_sd_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L263>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cas_sd_pt2 <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L1842>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cas_sd_pt2_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L1358>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cas_sd_pt2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L1661>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cas_sd_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L1112>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cas_sd_selected_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L594>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cas_sd_selected_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CAS_SD/H_apply.irp.f_shell_16#L917>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
.. image:: tree_dependancy.png
.. image:: tree_dependency.png
* `Perturbation <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation>`_
* `Selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Selectors_full>`_

View File

@ -52,7 +52,7 @@ program full_ci
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
call ezfio_set_full_ci_energy(CI_energy)
call ezfio_set_cas_sd_energy(CI_energy)
if (abort_all) then
exit
endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

30
src/CID/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps
Pseudo
Integrals_Monoelec
Bitmask
Integrals_Bielec
AOs
Selectors_full
MOs
Hartree_Fock
Determinants
Electrons
Utils
Nuclei
MOGuess
SingleRefMethod
Ezfio_files
cid
cid_lapack

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -13,9 +13,9 @@ Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
.. image:: tree_dependancy.png
.. image:: tree_dependency.png
* `Selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Selectors_full>`_
* `SingleRefMethod <http://github.com/LCPQ/quantum_package/tree/master/src/SingleRefMethod>`_
@ -24,10 +24,25 @@ Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
`cisd <http://github.com/LCPQ/quantum_package/tree/master/src/CID/cid_lapack.irp.f#L1>`_
Undocumented
`h_apply_cisd <http://github.com/LCPQ/quantum_package/tree/master/src/CID/H_apply.irp.f_shell_8#L406>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID/H_apply.irp.f_shell_8#L1>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID/H_apply.irp.f_shell_8#L263>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

BIN
src/CID/tree_dependency.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

35
src/CID_SC2_selected/.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps
CID_selected
Pseudo
Integrals_Monoelec
Bitmask
CID
Integrals_Bielec
CISD_selected
AOs
Selectors_full
MOs
Hartree_Fock
Perturbation
CISD
Determinants
Electrons
Utils
Properties
Nuclei
MOGuess
SingleRefMethod
Ezfio_files
cid_sc2_selection

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -6,20 +6,35 @@ Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
`cisd_sc2_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CID_SC2_selected/cid_sc2_selection.irp.f#L1>`_
Undocumented
`h_apply_pt2 <http://github.com/LCPQ/quantum_package/tree/master/src/CID_SC2_selected/H_apply.irp.f_shell_9#L487>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_pt2_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_SC2_selected/H_apply.irp.f_shell_9#L1>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_pt2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_SC2_selected/H_apply.irp.f_shell_9#L306>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
.. image:: tree_dependancy.png
.. image:: tree_dependency.png
* `CID_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected>`_

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

33
src/CID_selected/.gitignore vendored Normal file
View File

@ -0,0 +1,33 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps
Pseudo
Integrals_Monoelec
Bitmask
CID
Integrals_Bielec
AOs
Selectors_full
MOs
Hartree_Fock
Perturbation
CISD
Determinants
Electrons
Utils
Properties
Nuclei
MOGuess
SingleRefMethod
Ezfio_files
cid_selection

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -6,23 +6,175 @@ Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
`h_apply_cisd_selection <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f#L13>`_
Undocumented
.. by the `update_README.py` script.
`cisd <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/cid_selection.irp.f#L1>`_
Undocumented
`h_apply_cisd_selection <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f#L13>`_
Undocumented
`h_apply_cisd_selection_delta_rho_one_point <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L1283>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_delta_rho_one_point_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L765>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_delta_rho_one_point_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L1088>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_dipole_moment_z <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L6631>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_dipole_moment_z_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L6113>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_dipole_moment_z_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L6436>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L5103>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_epstein_nesbet_2x2 <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L5867>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_epstein_nesbet_2x2_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L5349>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_2x2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L5672>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L4585>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L4908>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L4339>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_epstein_nesbet_sc2_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L3821>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_sc2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L4144>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L3575>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L3057>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_sc2_no_projected_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L3380>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_sc2_projected <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L2811>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_epstein_nesbet_sc2_projected_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L2293>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_epstein_nesbet_sc2_projected_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L2616>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_h_core <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L2047>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_h_core_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L1529>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_h_core_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L1852>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_moller_plesset <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L519>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_selection_moller_plesset_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L1>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_selection_moller_plesset_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CID_selected/H_apply.irp.f_shell_10#L324>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
.. image:: tree_dependancy.png
.. image:: tree_dependency.png
* `Perturbation <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation>`_
* `CID <http://github.com/LCPQ/quantum_package/tree/master/src/CID>`_

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

30
src/CIS/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps
Pseudo
Integrals_Monoelec
Bitmask
Integrals_Bielec
AOs
Selectors_full
MOs
Hartree_Fock
Determinants
Electrons
Utils
Nuclei
MOGuess
SingleRefMethod
Ezfio_files
super_ci
cis

View File

@ -1 +0,0 @@
* The molecular orbitals are assumed orthonormal

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -4,10 +4,6 @@ CIS Module
Assumptions
===========
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
* The molecular orbitals are assumed orthonormal
@ -15,23 +11,39 @@ Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
`cis <http://github.com/LCPQ/quantum_package/tree/master/src/CIS/super_ci.irp.f#L1>`_
Undocumented
`h_apply_cis <http://github.com/LCPQ/quantum_package/tree/master/src/CIS/H_apply.irp.f_shell_8#L406>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cis_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CIS/H_apply.irp.f_shell_8#L1>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cis_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CIS/H_apply.irp.f_shell_8#L263>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`super_ci <http://github.com/LCPQ/quantum_package/tree/master/src/CIS/super_ci.irp.f#L9>`_
Undocumented
Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
.. image:: tree_dependancy.png
.. image:: tree_dependency.png
* `Selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Selectors_full>`_
* `SingleRefMethod <http://github.com/LCPQ/quantum_package/tree/master/src/SingleRefMethod>`_

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

BIN
src/CIS/tree_dependency.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

30
src/CISD/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps
Pseudo
Integrals_Monoelec
Bitmask
Integrals_Bielec
AOs
Selectors_full
MOs
Hartree_Fock
Determinants
Electrons
Utils
Nuclei
MOGuess
SingleRefMethod
Ezfio_files
cisd_lapack
cisd

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -13,9 +13,9 @@ Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
.. image:: tree_dependancy.png
.. image:: tree_dependency.png
* `Selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Selectors_full>`_
* `SingleRefMethod <http://github.com/LCPQ/quantum_package/tree/master/src/SingleRefMethod>`_
@ -24,10 +24,25 @@ Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.
.. by the `update_README.py` script.
`cisd <http://github.com/LCPQ/quantum_package/tree/master/src/CISD/cisd_lapack.irp.f#L1>`_
Undocumented
`h_apply_cisd <http://github.com/LCPQ/quantum_package/tree/master/src/CISD/H_apply.irp.f_shell_8#L406>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_cisd_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/CISD/H_apply.irp.f_shell_8#L1>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_cisd_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/CISD/H_apply.irp.f_shell_8#L263>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

33
src/CISD_SC2_selected/.gitignore vendored Normal file
View File

@ -0,0 +1,33 @@
#
# Do not modify this file. Add your ignored files to the gitignore
# (without the dot at the beginning) file.
#
IRPF90_temp
IRPF90_man
irpf90.make
tags
Makefile.depend
irpf90_entities
build.ninja
.ninja_log
.ninja_deps
Pseudo
Integrals_Monoelec
Bitmask
Integrals_Bielec
CISD_selected
AOs
Selectors_full
MOs
Hartree_Fock
Perturbation
CISD
Determinants
Electrons
Utils
Properties
Nuclei
MOGuess
SingleRefMethod
Ezfio_files
cisd_sc2_selection

View File

@ -1,6 +0,0 @@
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

Some files were not shown because too many files have changed in this diff Show More