-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add the explanation of autotest to doc #891
Closed
Closed
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2fb5049
add the explanation about autotest
yato0422 b39f070
add the explanation about autotest
yato0422 2a49d88
Update autotest.md
yato0422 c22898e
Update index.rst
yato0422 7a8b38f
Update autotest.md
yato0422 077f80e
Make some changes to the documentation of autotest
yato0422 f4145ba
add a title
yato0422 182f1ef
add the titles of autotest
yato0422 d1788f1
add the titles
yato0422 cca9bbd
Update index.rst
yato0422 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# Auto test | ||
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. | ||
|
||
## Relaxation | ||
The relaxation of a structure should be carried out before calculating all other properties: | ||
|
||
``` | ||
dpgen autotest make equi.json | ||
dpgen autotest run relax.json machine.json | ||
dpgen autotest post equi.json | ||
``` | ||
|
||
If, for some reason, 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: | ||
|
||
``` | ||
{ | ||
"structures": "confs/mp-*", | ||
"interaction": { | ||
"type": "deepmd", | ||
"model": "frozen_model.pb", | ||
"type_map": {"Al": 0, "Mg": 1} | ||
}, | ||
"relaxation": { | ||
} | ||
} | ||
``` | ||
|
||
where the key `structures` provides the structures to relax. `interaction` is provided with `deepmd`, and other options are `vasp`, `eam`, `meam`... | ||
|
||
Yuzhi: | ||
|
||
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. | ||
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`. | ||
|
||
``` | ||
ls mp-* | ||
mp-1/relaxation mp-2/relaxation mp-3/relaxation | ||
``` | ||
|
||
## Other properties | ||
Other properties can be computed in parallel: | ||
|
||
``` | ||
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 | ||
|
||
``` | ||
{ | ||
"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 | ||
} | ||
] | ||
} | ||
``` | ||
|
||
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 | ||
|
||
``` | ||
ls mp-*/ | grep eos | ||
mp-1/eos_00 mp-2/eos_00 mp-3/eos_00 | ||
``` | ||
|
||
where `00` are suffix of the task. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are also many other properties. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is just a simple example. A full one see |
||
|
||
## 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. | ||
|
||
``` | ||
dpgen autotest make refine.json | ||
dpgen autotest run refine.json machine.json | ||
``` | ||
|
||
with `refine.json` | ||
|
||
``` | ||
{ | ||
"properties": { | ||
"eos" : { | ||
"init_from_suffix": "00", | ||
"output_suffix": "01", | ||
"vol_start": 10, | ||
"vol_end": 30, | ||
"vol_step": 0.5 | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Configuration filter | ||
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 | ||
|
||
``` | ||
{ | ||
"properties": { | ||
"intersitital" : { | ||
"supercell": [3,3,3], | ||
"insert_atom": ["Al"], | ||
"conf_filters": [ | ||
{ "min_dist": 2 } | ||
] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove this line?