forked from deepmodeling/dpgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix contents according to comments in deepmodeling#891 - reorganize the document structure
- Loading branch information
1 parent
18f1e09
commit 2cc2bf1
Showing
49 changed files
with
247 additions
and
401 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,124 +1,114 @@ | ||
## Auto-test Overview | ||
## Autotest Overview: Autotest for Deep Generator | ||
Suppose that we have a potential (can be DFT, DP, MEAM ...), `autotest` helps us automatically calculate M properties on N configurations. The folder where the `autotest` runs is called the working directory of `autotest`. Different potentials should be tested in different working directories. | ||
|
||
Suppose that we have a potential (can be DFT, DP, MEAM ...), `autotest` helps us automatically calculate M porperties on N configurations. The folder where the `autotest` runs is called the `autotest`'s working directory. Different potentials should be tested in different working directories. | ||
|
||
A property is tested in three stages: `make`, `run` and `post`. `make` prepare all computational tasks that are needed to calculate the property. For example to calculate EOS, `autotest` prepare a series of tasks, each of which has a scaled configuration with certain volume, and all necessary input files necessary for starting a VAPS or LAMMPS relaxation. `run` sends all the computational tasks to remote computational resources defined in a machine configuration file like `machine.json`, and automatically collect the results when remote calculations finish. `post` calculates the desired property from the collected results. | ||
A property is tested in three steps: `make`, `run` and `post`. `make` prepares all computational tasks that are needed to calculate the property. For example to calculate EOS, `make` prepares a series of tasks, each of which has a scaled configuration with certain volume, and all necessary input files necessary for starting a VASP, ABACUS, or LAMMPS calculations. `run` sends all the computational tasks to remote computational resources defined in a machine configuration file like `machine.json`, and automatically collects the results when remote calculations finish. `post` calculates the desired property from the collected results. | ||
|
||
### Relaxation | ||
|
||
The relaxation of a structure should be carried out before calculating all other properties: | ||
```bash | ||
dpgen autotest make equi.json | ||
dpgen autotest make relax.json | ||
dpgen autotest run relax.json machine.json | ||
dpgen autotest post equi.json | ||
dpgen autotest post relax.json | ||
``` | ||
If, for some reason, the main program terminated at stage `run`, one can easily restart with the same command. | ||
If, for some reasons, the main program terminated at stage `run`, one can easily restart with the same command. | ||
`relax.json` is the parameter file. An example for `deepmd` relaxation is given as: | ||
```json | ||
{ | ||
"structures": "confs/mp-*", | ||
"interaction": { | ||
"type": "deepmd", | ||
"model": "frozen_model.pb", | ||
"structures": "confs/mp-*", | ||
"interaction": { | ||
"type": "deepmd", | ||
"model": "frozen_model.pb", | ||
"type_map": {"Al": 0, "Mg": 1} | ||
}, | ||
"relaxation": { | ||
} | ||
}, | ||
"relaxation": {} | ||
} | ||
``` | ||
|
||
where the key `structures` provides the structures to relax. `interaction` is provided with `deepmd`, and other options are `vasp`, `eam`, `meam`... | ||
where the key `structures` provides the structures to relax. `interaction` is provided with `deepmd`, and other options are `vasp`, `abacus`, `meam`... | ||
|
||
Yuzhi: | ||
### Task type | ||
There are now six task types implemented in the package: `vasp`, `abacus`, `deepmd`, `meam`, `eam_fs`, and `eam_alloy`. An `inter.json` file in json format containing the interaction parameters will be written in the directory of each task after `make`. We give input examples of the `interaction` part for each type below: | ||
|
||
1. We should notice that the `interaction` here should always be considered as a unified abstract class, which means that we should avoid repeating identifing which interaction we're using in the main code. | ||
2. The structures here should always considered as a list, and the wildcard should be supported by using `glob`. Before all calculations , there is a stage where we generate the configurations. | ||
|
||
The outputs of the relaxation are stored in the `mp-*/00.relaxation` directory. | ||
```bash | ||
ls mp-* | ||
mp-1/relaxation mp-2/relaxation mp-3/relaxation | ||
``` | ||
|
||
### Other properties | ||
|
||
Other properties can be computed in parallel: | ||
```bash | ||
dpgen autotest make properties.json | ||
dpgen autotest run properties.json machine.json | ||
dpgen autotest post properties.json | ||
``` | ||
where an example of `properties.json` is given by | ||
**VASP**: | ||
|
||
The default of `potcar_prefix` is "". | ||
```json | ||
{ | ||
"structures": "confs/mp-*", | ||
"interaction": { | ||
"type": "vasp", | ||
"incar": "vasp_input/INCAR", | ||
"potcar_prefix":"vasp_input", | ||
"potcars": {"Al": "POTCAR.al", "Mg": "POTCAR.mg"} | ||
}, | ||
"properties": [ | ||
{ | ||
"type": "eos", | ||
"vol_start": 10, | ||
"vol_end": 30, | ||
"vol_step": 0.5 | ||
}, | ||
{ | ||
"type": "elastic", | ||
"norm_deform": 2e-2, | ||
"shear_deform": 5e-2 | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
**ABACUS**: | ||
|
||
The default of `potcar_prefix` is "". The path of potcars/orb_files/deepks_desc is `potcar_prefix` + `potcars`/`orb_files`/`deepks_desc`. | ||
```json | ||
"interaction": { | ||
"type": "abacus", | ||
"incar": "abacus_input/INPUT", | ||
"potcar_prefix":"abacus_input", | ||
"potcars": {"Al": "pseudo_potential.al", "Mg": "pseudo_potential.mg"}, | ||
"orb_files": {"Al": "numerical_orb.al", "Mg": "numerical_orb.mg"}, | ||
"atom_masses": {"Al": 26.9815, "Mg":24.305}, | ||
"deepks_desc": "jle.orb" | ||
} | ||
``` | ||
**deepmd**: | ||
|
||
**Only 1** model can be used in autotest in one working directory. | ||
|
||
The `dpgen` packed all `eos` and `elastic` task and sends them to corresponding computational resources defined in `machine.json`. The outputs of a property, taking `eos` for example, are stored in | ||
```bash | ||
ls mp-*/ | grep eos | ||
mp-1/eos_00 mp-2/eos_00 mp-3/eos_00 | ||
```json | ||
"interaction": { | ||
"type": "deepmd", | ||
"model": "frozen_model.pb", | ||
"type_map": {"Al": 0, "Mg": 1} | ||
} | ||
``` | ||
where `00` are suffix of the task. | ||
**meam**: | ||
|
||
### Refine the calculation of a property | ||
|
||
Some times we want to refine the calculation of a property from previous results. For example, when higher convergence criteria `EDIFF` and `EDIFFG` are necessary, and the new VASP calculation is desired to start from the previous output configration, rather than starting from scratch. | ||
```bash | ||
dpgen autotest make refine.json | ||
dpgen autotest run refine.json machine.json | ||
Please make sure the [USER-MEAMC package](https://lammps.sandia.gov/doc/Packages_details.html#pkg-user-meamc) has already been installed in LAMMPS. | ||
```json | ||
"interaction": { | ||
"type": "meam", | ||
"model": ["meam.lib","AlMg.meam"], | ||
"type_map": {"Al": 1, "Mg": 2} | ||
} | ||
``` | ||
with `refine.json` | ||
**eam_fs & eam_alloy**: | ||
|
||
Please make sure the [MANYBODY package](https://lammps.sandia.gov/doc/Packages_details.html#pkg-manybody) has already been installed in LAMMPS | ||
```json | ||
{ | ||
"properties": { | ||
"eos" : { | ||
"init_from_suffix": "00", | ||
"output_suffix": "01", | ||
"vol_start": 10, | ||
"vol_end": 30, | ||
"vol_step": 0.5 | ||
} | ||
} | ||
} | ||
"interaction": { | ||
"type": "eam_fs (eam_alloy)", | ||
"model": "AlMg.eam.fs (AlMg.eam.alloy)", | ||
"type_map": {"Al": 1, "Mg": 2} | ||
} | ||
``` | ||
|
||
### Property type | ||
|
||
Now the supported property types are `eos`, `elastic`, `vacancy`, `interstitial`, `surface`, and `gamma`. Before property tests, `relaxation` should be done first or the relaxation results should be present in the corresponding directory `confs/mp-*/relaxation/relax_task`. A file named `task.json` in json format containing the property parameter will be written in the directory of each task after `make` step. Multiple property tests can be performed simultaneously. | ||
|
||
### Configuration filter | ||
## Make run and post | ||
|
||
Some times the configurations automatically generated are problematic. For example, the distance between the interstitial atom and the lattic is too small, then these configurations should be filtered out. One can set filters of configurations by | ||
```json | ||
{ | ||
"properties": { | ||
"intersitital" : { | ||
"supercell": [3,3,3], | ||
"insert_atom": ["Al"], | ||
"conf_filters": [ | ||
{ "min_dist": 2 } | ||
] | ||
} | ||
} | ||
} | ||
There are three operations in auto test package, namely `make`, `run`, and `post`. Here we take `eos` property as an example for property type. | ||
|
||
### Make | ||
The `INCAR`, `POSCAR`, `POTCAR` input files for VASP or `in.lammps`, `conf.lmp`, and the interatomic potential files for LAMMPS will be generated in the directory `confs/mp-*/relaxation/relax_task` for relaxation or `confs/mp-*/eos_00/task.[0-9]*[0-9]` for EOS. The `machine.json` file is not needed for `make`. Example: | ||
```bash | ||
dpgen autotest make relaxation.json | ||
``` | ||
|
||
### Run | ||
The jobs would be dispatched according to the parameter in `machine.json` file and the calculation results would be sent back. Example: | ||
```bash | ||
dpgen autotest run relaxation.json machine.json | ||
``` | ||
|
||
### Post | ||
The post process of calculation results would be performed. `result.json` in json format will be generated in `confs/mp-*/relaxation/relax_task` for relaxation and `result.json` in json format and `result.out` in txt format in `confs/mp-*/eos_00` for EOS. The `machine.json` file is also not needed for `post`. Example: | ||
```bash | ||
dpgen autotest post relaxation.json | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.