10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-08-16 17:48:32 +02:00

Merge pull request #78 from TApplencourt/master

README
This commit is contained in:
Thomas Applencourt 2015-06-20 20:09:46 +02:00
commit ac24ddb73b
4 changed files with 92 additions and 50 deletions

View File

@ -1,4 +1,8 @@
sudo: true sudo: true
#
#cache:
# directories:
# - $HOME/.opam/
language: python language: python
python: python:

View File

@ -117,3 +117,45 @@ You can type `ninja all` in a module for compiling all the submodule
ssh -fN -D 10000 user@external-server.com ssh -fN -D 10000 user@external-server.com
# Note on EZFIO.cfg
##Format specification :
```
Required:
[<provider_name>] The name of the provider in irp.f90 and in the EZFIO lib
doc:<str> The plain text documentation
type:<str> A Fancy_type supported by the ocaml.
type `ei_handler.py get_supported_type` for a list
interface:<str> The interface is list of string sepeared by "," who can containt :
- ezfio (if you only whant the ezfiolib)
- provider (if you want the provider)
- ocaml (if you want the ocaml gestion)
Optional:
default: <str> The default value needed,
if 'ocaml' is in interface list.
! No list is allowed for now !
size: <str> The size information.
(by default is one)
Example : 1, =sum(ao_num); (ao_num,3)
ezfio_name: <str> The name for the EZFIO lib
(by default is <provider_name>)
ezfio_dir: <str> Will be the folder of EZFIO.
(by default is <module_lower>)
```
##Example of EZFIO.cfg:
```
[thresh_SCF]
doc: Threshold on the convergence of the Hartree Fock energy
type: Threshold
default: 1.e-10
interface: provider,ezfio,ocaml
size: 1
[energy]
type: Strictly_negative_float
doc: Calculated HF energy
interface: ezfio
```

View File

@ -10,40 +10,44 @@ Usage:
[--ezfio_config] [--ezfio_config]
[--ocaml] [--ocaml]
[--ezfio_default] [--ezfio_default]
ei_handler.py list_supported_type
ei_handler.py ocaml_global ei_handler.py ocaml_global
By default all the option are executed. By default all the option are executed.
Options: Options:
-h --help -h --help
--irpf90 Create the `ezfio_interface.irpf90` --irpf90 Create the `<module>/ezfio_interface.irpf90`
which contains all the providers needed which contains all the providers needed
(aka all with the `interface: input` parameter) --ezfio_config Create the `<module_lower>_ezfio_interface_config` in
in `${pwd}` `${QP_EZFIO}/config/`
--ezfio_config Create the `${module_lower}_ezfio_interface_config` in --ocaml Create all the stuff needed by *qp_edit*:
`${QP_ROOT}/EZFIO/config/` -`Input_<module_lower>.ml` and
This file is needed by *EZFIO* to create the `libezfio.so` - <module_lower>_ezfio_interface_default`
--ocaml Create the `Input_module.lower.ml` for the *qp_edit* ocaml_global Create the *qp_edit*
--ezfio_default Create the `${module_lower}_ezfio_interface_default` in
`${QP_ROOT}/data/ezfio_defaults` needed by
the ocaml
ocaml_global Create the qp_edit
Format specification : Format specification :
[provider_name] | the name of the provider in irp.f90
doc:{str} | Is the doc Required:
Type:{str} | Is a fancy_type supported by the ocaml [<provider_name>] The name of the provider in irp.f90 and in the EZFIO lib
ezfio_name:{str} | Will be the name of the file for the ezfio doc:<str> The plain text documentation
(optional by default is the name of the provider) type:<str> A Fancy_type supported by the ocaml.
interface:{str} | The provider is string sepeared by "," who can containt type `ei_handler.py get_supported_type` for a list
ezfio (if you only whant the ezfiolib) interface:<str> The interface is list of string sepeared by "," who can containt :
provider (if you want the provider) - ezfio (if you only whant the ezfiolib)
ocaml (if you want the ocaml gestion) - provider (if you want the provider)
So for example: - ocaml (if you want the ocaml gestion)
interface: provider,ezfio,ocaml Optional:
default:{str} | The default value if 'ocam' in interface: default: <str> The default value needed,
size:{str} | the size information if 'ocaml' is in interface list.
(like 1 or =sum(ao_num) or (ao_num,3) ) ! No list is allowed for now !
size: <str> The size information.
(by default is one)
Example : 1, =sum(ao_num); (ao_num,3)
ezfio_name: <str> The name for the EZFIO lib
(by default is <provider_name>)
ezfio_dir: <str> Will be the folder of EZFIO.
(by default is <module_lower>)
Example of EZFIO.cfg: Example of EZFIO.cfg:
``` ```
@ -198,19 +202,6 @@ def get_dict_config_file(module_obj):
size, size,
interface, interface,
default} default}
- Type : Is a Type named tuple who containt
fortran and ocaml type
- doc : Is the doc
- ezfio_name : Will be the name of the file
- ezfio_dir : Will be the folder who containt the ezfio_name
* /ezfio_dir/ezfio_name
* equal to MODULE_lower name by default.
- interface : The provider is lit of [provider,ezfio,ocaml]
- default : The default value /!\ stored in a Type named type!
if interface == input
- size : Is the string read in ezfio.cgf who containt the size information
(like 1 or =sum(ao_num))
""" """
# ~#~#~#~ # # ~#~#~#~ #
# I n i t # # I n i t #
@ -730,9 +721,9 @@ def code_generation(arguments, dict_ezfio_cfg, m):
str_ezfio_config = create_ezfio_config(dict_ezfio_cfg) str_ezfio_config = create_ezfio_config(dict_ezfio_cfg)
save_ezfio_config(module_lower, str_ezfio_config) save_ezfio_config(module_lower, str_ezfio_config)
# ~#~#~#~#~#~# # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
# O c a m l # # O c a m l & e z f i o _ d e f a u l t #
# ~#~#~#~#~#~# # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
if do_all or arguments["--ocaml"]: if do_all or arguments["--ocaml"]:
try: try:
str_ocaml_input = create_ocaml_input(dict_ezfio_cfg, module_lower) str_ocaml_input = create_ocaml_input(dict_ezfio_cfg, module_lower)
@ -741,20 +732,19 @@ def code_generation(arguments, dict_ezfio_cfg, m):
else: else:
save_ocaml_input(module_lower, str_ocaml_input) save_ocaml_input(module_lower, str_ocaml_input)
# ~#~#~#~#~#~#~#~#~#~#~#~#~ #
# e z f i o _ d e f a u l t #
# ~#~#~#~#~#~#~#~#~#~#~#~#~ #
if do_all or arguments["--ezfio_default"]:
str_ezfio_default = create_ezfio_default(dict_ezfio_cfg) str_ezfio_default = create_ezfio_default(dict_ezfio_cfg)
save_ezfio_default(module_lower, str_ezfio_default) save_ezfio_default(module_lower, str_ezfio_default)
if __name__ == "__main__": if __name__ == "__main__":
arguments = docopt(__doc__) arguments = docopt(__doc__)
# ___ # ___
# | ._ o _|_ # | ._ o _|_
# _|_ | | | |_ # _|_ | | | |_
# #
if arguments["list_supported_type"]:
for i in get_type_dict():
print i
sys.exit(0)
if arguments["ocaml_global"]: if arguments["ocaml_global"]:
@ -763,7 +753,6 @@ if __name__ == "__main__":
# ~#~#~#~# # # ~#~#~#~# #
l_module = get_l_module_with_auto_generate_ocaml_lower() l_module = get_l_module_with_auto_generate_ocaml_lower()
print l_module
str_ocaml_qp_edit, str_ocaml_input_auto = create_ocaml_input_global(l_module) str_ocaml_qp_edit, str_ocaml_input_auto = create_ocaml_input_global(l_module)
save_ocaml_input_auto(str_ocaml_input_auto) save_ocaml_input_auto(str_ocaml_input_auto)

View File

@ -175,8 +175,16 @@ class ModuleHandler():
draw_module_edge(children, d_ref[children]) draw_module_edge(children, d_ref[children])
all_ready_done.append(module) all_ready_done.append(module)
path = '{0}.png'.format("tree_dependency")
# Init # Init
try:
graph = pydot.Dot(graph_type='digraph') graph = pydot.Dot(graph_type='digraph')
except:
with open(path, 'a'):
os.utime(path, None)
return
d_ref = self.dict_child d_ref = self.dict_child
# Create all the edge # Create all the edge
@ -186,7 +194,6 @@ class ModuleHandler():
draw_module_edge(module, d_ref[module]) draw_module_edge(module, d_ref[module])
# Save # Save
path = '{0}.png'.format("tree_dependency")
graph.write_png(path) graph.write_png(path)