10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-22 18:57:31 +02:00

Merge branch 'LCPQ-master'

This commit is contained in:
Anthony Scemama 2017-07-22 23:03:40 +02:00
commit 4bfd6de1bf
3 changed files with 26 additions and 26 deletions

View File

@ -32,27 +32,21 @@ Demo
### 1) Configure ### 1) Configure
$ ./configure <config_file> (--production | --development) $ ./configure <config_file>
For example you can type `./configure config/gfortran.cfg --production` For example you can type `./configure config/gfortran.cfg`
This command has two purposes : This command has two purposes :
- Download and install all the requirements. - Download and install all the requirements.
Installing OCaml and the Core library may take some time (up to 20min on an old machine). Installing OCaml and the Core library may take some time (up to 20min on an old machine).
- Create the file which contains all the dependencies for the binaries. - Create the file which contains all the dependencies for the binaries.
It's not a Makefile, but a Ninja file (so don't type `make` is hopeless, type `ninja` instead) It's not a Makefile, but a Ninja file (so don't type `make` it's hopeless, type `ninja` instead)
####Compilation Flags (`<config_file>`) #### Compilation Flags (`<config_file>`)
`<config_file>` is the path to the file which contains all the compilation flags (optimization flags, Lapack libary, etc). There are two example configure files in ``$QP_ROOT/config`` : ``ifort.cfg`` and ``gfortran.cfg``. You can copy these files to create a new file adapted to your architecture. `<config_file>` is the path to the file which contains all the compilation flags (optimization flags, Lapack libary, etc). There are two example configure files in ``$QP_ROOT/config`` : ``ifort.cfg`` and ``gfortran.cfg``. You can copy these files to create a new file adapted to your architecture.
#### What utilization of the code will you do?
* If you only want the binaries (for production workflow) use the flag
`--production`. It compiles faster.
* Else if you are a developer and you want to be able to compile specific modules use: `--development`. It will create the `build.ninja` in each module.
### 2) Load environment variables ### 2) Load environment variables
source quantum_package.rc source quantum_package.rc
@ -75,24 +69,16 @@ Usage:
### 3) Compiling the Fortran ### 3) Compiling the Fortran
Just type `ninja` if you are in `$QP_ROOT` (or `ninja -f $QP_ROOT/build.ninja` elsewhere). The compilation will take approximately 3 min. Just type `ninja` if you are in `$QP_ROOT`. The compilation will take approximately 3 min.
If you have set the `--developement` flag you can go in any module directory and run `ninja` to build only this particular module. You can type `ninja all` in a module to compile all the submodules.
### 4) Compiling the OCaml
make -C $QP_ROOT/ocaml
### 5) Testing if all is ok ### 5) Testing if all is ok
cd tests ; ./run_tests.sh cd tests ; ./run_tests.sh
# Note on EZFIO.cfg # Note on EZFIO.cfg
##Format specification : ## Format specification:
``` ```
Required: Required:
@ -119,7 +105,7 @@ Optional:
(by default is <module_lower>) (by default is <module_lower>)
``` ```
##Example of EZFIO.cfg: ## Example of EZFIO.cfg:
``` ```
[thresh_SCF] [thresh_SCF]
@ -135,19 +121,23 @@ doc: Calculated HF energy
interface: ezfio interface: ezfio
``` ```
#FAQ # FAQ
### My hartree-Fock segfault !
A old version of Lapack have a bug. Just relax your convergence criterium
### Error: ezfio_* is already defined. ### Error: ezfio_* is already defined.
#### Why ? #### Why ?
You have two or more ezfio configuration files for the same variable. Check files in `$QP_ROOT/install/EZFIO/config/` You have two or more ezfio configuration files for the same variable. Check files in `$QP_ROOT/install/EZFIO/config/` and the all the `EZFIO.cfg`.
#### Fix #### Fix
- rm $QP_ROOT/install/EZFIO/config/* - rm $QP_ROOT/install/EZFIO/config/*
- ninja - ninja
### Error: Seg Fault (139) ### Error: Seg Fault (139)
@ -160,7 +150,7 @@ Program exited with code 139.
It's caused when we call the DGEMM routine of LAPACK. It's caused when we call the DGEMM routine of LAPACK.
##### Fix #### Fix
Set `ulimit -s unlimited`, before runing `qp_run`. It seems to fix the problem. Set `ulimit -s unlimited`, before runing `qp_run`. It seems to fix the problem.

View File

@ -10,6 +10,7 @@ type t =
|Na|Mg |Al|Si|P |S |Cl|Ar |Na|Mg |Al|Si|P |S |Cl|Ar
|K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr |K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr
|Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe |Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe
|Pt
with sexp with sexp
let of_string x = let of_string x =
@ -69,6 +70,7 @@ let of_string x =
| "Te" | "Tellurium" -> Te | "Te" | "Tellurium" -> Te
| "I" | "Iodine" -> I | "I" | "Iodine" -> I
| "Xe" | "Xenon" -> Xe | "Xe" | "Xenon" -> Xe
| "Pt" | "Platinum" -> Pt
| x -> raise (ElementError ("Element "^x^" unknown")) | x -> raise (ElementError ("Element "^x^" unknown"))
@ -128,6 +130,7 @@ let to_string = function
| Te -> "Te" | Te -> "Te"
| I -> "I" | I -> "I"
| Xe -> "Xe" | Xe -> "Xe"
| Pt -> "Pt"
let to_long_string = function let to_long_string = function
@ -186,6 +189,7 @@ let to_long_string = function
| Te -> "Tellurium" | Te -> "Tellurium"
| I -> "Iodine" | I -> "Iodine"
| Xe -> "Xenon" | Xe -> "Xenon"
| Pt -> "Platinum"
let to_charge c = let to_charge c =
@ -245,6 +249,7 @@ let to_charge c =
| Te -> 52 | Te -> 52
| I -> 53 | I -> 53
| Xe -> 54 | Xe -> 54
| Pt -> 78
in Charge.of_int result in Charge.of_int result
@ -304,6 +309,7 @@ let of_charge c = match (Charge.to_int c) with
| 52 -> Te | 52 -> Te
| 53 -> I | 53 -> I
| 54 -> Xe | 54 -> Xe
| 78 -> Pt
| x -> raise (ElementError ("Element of charge "^(string_of_int x)^" unknown")) | x -> raise (ElementError ("Element of charge "^(string_of_int x)^" unknown"))
@ -364,6 +370,7 @@ let covalent_radius x =
| Te -> 1.38 | Te -> 1.38
| I -> 1.39 | I -> 1.39
| Xe -> 1.40 | Xe -> 1.40
| Pt -> 1.30
in in
Units.angstrom_to_bohr *. (result x) Units.angstrom_to_bohr *. (result x)
|> Positive_float.of_float |> Positive_float.of_float
@ -425,6 +432,7 @@ let vdw_radius x =
| Te -> 2.06 | Te -> 2.06
| I -> 1.98 | I -> 1.98
| Xe -> 2.16 | Xe -> 2.16
| Pt -> 1.75
in in
Units.angstrom_to_bohr *. (result x) Units.angstrom_to_bohr *. (result x)
|> Positive_float.of_float |> Positive_float.of_float
@ -486,6 +494,7 @@ let mass x =
| Te -> 127.60 | Te -> 127.60
| I -> 126.90447 | I -> 126.90447
| Xe -> 131.293 | Xe -> 131.293
| Pt -> 195.084
in in
result x result x
|> Positive_float.of_float |> Positive_float.of_float

View File

@ -7,6 +7,7 @@ type t =
|Na|Mg |Al|Si|P |S |Cl|Ar |Na|Mg |Al|Si|P |S |Cl|Ar
|K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr |K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr
|Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe |Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe
|Pt
with sexp with sexp
(** String conversion functions *) (** String conversion functions *)