Skip to content

Commit e9d5952

Browse files
authored
Merge pull request #523 from deepmodeling/devel
Merge devel into master
2 parents da49465 + af217d5 commit e9d5952

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1354
-486
lines changed

.github/workflows/mirror_gitee.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
ORGANIZATION: deepmodeling
1616
SSH_PRIVATE_KEY: ${{ secrets.SYNC_GITEE_PRIVATE_KEY }}
1717
with:
18-
source-repo: "git@github.com:deepmodeling/dpgen.git"
18+
source-repo: "https://github.com/deepmodeling/dpgen.git"
1919
destination-repo: "git@gitee.com:deepmodeling/dpgen.git"

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: release_conda_and_github
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish-conda:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: publish-to-conda
14+
uses: felix5572/conda-publish-action@v1.9
15+
with:
16+
subdir: 'conda'
17+
anacondatoken: ${{ secrets.ANACONDA_TOKEN }}
18+
platforms: 'noarch'
19+
construct-and-publish:
20+
runs-on: ubuntu-latest
21+
needs: conda-publish
22+
steps:
23+
- uses: actions/checkout@master
24+
- uses: s-weigand/setup-conda@v1
25+
- run: conda install constructor jinja2 -y
26+
- run: constructor ./conda
27+
- name: Upload to release
28+
uses: softprops/action-gh-release@master
29+
if: startsWith(github.ref, 'refs/tags/')
30+
with:
31+
files: dpgen-*.sh
32+
repository: ${{ env.GITHUB_REPOSITORY }}
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CITATION.cff

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
preferred-citation:
2+
type: article
3+
authors:
4+
- family-names: "Zhang"
5+
given-names: "Yuzhi"
6+
- family-names: "Wang"
7+
given-names: "Haidi"
8+
- family-names: "Chen"
9+
given-names: "Weijie"
10+
- family-names: "Zeng"
11+
given-names: "Jinzhe"
12+
- family-names: "Zhang"
13+
given-names: "Linfeng"
14+
- family-names: "Wang"
15+
given-names: "Han"
16+
- family-names: "E"
17+
given-names: "Weinan"
18+
doi: "10.1016/j.cpc.2020.107206"
19+
journal: "Computer Physics Communications"
20+
month: 8
21+
start: 107206 # First page number
22+
end: 107206 # Last page number
23+
title: "DP-GEN: A concurrent learning platform for the generation of reliable deep learning based potential energy models"
24+
volume: 253
25+
year: 2020

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
[![conda install](https://img.shields.io/conda/dn/conda-forge/dpgen?label=conda%20install)](https://anaconda.org/conda-forge/dpgen)
2626
[![pip install](https://img.shields.io/pypi/dm/dpgen?label=pip%20install)](https://pypi.org/project/dpgen)
2727

28-
DP-GEN (Deep Generator) is a software written in Python, delicately designed to generate a deep learning based model of interatomic potential energy and force field. DP-GEN is depedent on DeepMD-kit (https://github.com/deepmodeling/deepmd-kit/blob/master/README.md). With highly scalable interface with common softwares for molecular simulation, DP-GEN is capable to automatically prepare scripts and maintain job queues on HPC machines (High Performance Cluster) and analyze results.
28+
DP-GEN (Deep Generator) is a software written in Python, delicately designed to generate a deep learning based model of interatomic potential energy and force field. DP-GEN is dependent on [DeepMD-kit](https://github.com/deepmodeling/deepmd-kit/blob/master/README.md). With highly scalable interface with common softwares for molecular simulation, DP-GEN is capable to automatically prepare scripts and maintain job queues on HPC machines (High Performance Cluster) and analyze results.
2929

3030
If you use this software in any publication, please cite:
3131

@@ -34,7 +34,7 @@ Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and
3434
### Highlighted features
3535
+ **Accurate and efficient**: DP-GEN is capable to sample more than tens of million structures and select only a few for first principles calculation. DP-GEN will finally obtain a uniformly accurate model.
3636
+ **User-friendly and automatic**: Users may install and run DP-GEN easily. Once succusefully running, DP-GEN can dispatch and handle all jobs on HPCs, and thus there's no need for any personal effort.
37-
+ **Highly scalable**: With modularized code structures, users and developers can easily extend DP-GEN for their most relevant needs. DP-GEN currently supports for HPC systems (Slurm, PBS, LSF and cloud machines ), Deep Potential interface with DeePMD-kit, MD interface with LAMMPS and *ab-initio* calculation interface with VASP, PWSCF,SIESTA and Gaussian. We're sincerely welcome and embraced to users' contributions, with more possibilities and cases to use DP-GEN.
37+
+ **Highly scalable**: With modularized code structures, users and developers can easily extend DP-GEN for their most relevant needs. DP-GEN currently supports for HPC systems (Slurm, PBS, LSF and cloud machines ), Deep Potential interface with DeePMD-kit, MD interface with [LAMMPS](https://www.lammps.org/), [Gromacs](http://www.gromacs.org/) and *ab-initio* calculation interface with VASP, PWSCF, CP2K, SIESTA and Gaussian, Abacus, PWMAT, etc . We're sincerely welcome and embraced to users' contributions, with more possibilities and cases to use DP-GEN.
3838

3939
### Code structure and interface
4040
+ dpgen:
@@ -43,7 +43,8 @@ Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and
4343
* generator: source codes for main process of deep generator.
4444

4545
* auto_test : source code for undertaking materials property analysis.
46-
* remote : source code for automatically submiting scripts,maintaining job queues and collecting results.
46+
* remote and dispatcher : source code for automatically submiting scripts,maintaining job queues and collecting results.
47+
Notice this part hase been integrated into [dpdispatcher](https://github.com/deepmodeling/dpdispatcher)
4748
* database : source code for collecting data generated by DP-GEN and interface with database.
4849
+ examples : providing example JSON files.
4950

@@ -63,6 +64,15 @@ Options for TASK:
6364
* `test`: Auto-test for Deep Potential.
6465
* `db`: Collecting data from DP-GEN.
6566

67+
68+
[Here](examples) are examples you can refer to. You should make sure that provide a correct [JSON](https://docs.python.org/3/library/json.html) file.
69+
You can use following command to check your JSON file.
70+
```python
71+
import json
72+
#Specify machine parameters in machine.json
73+
json.load(open("machine.json"))
74+
```
75+
6676
## Download and Install
6777
One can download the source code of dpgen by
6878
```bash
@@ -539,8 +549,14 @@ The bold notation of key (such aas **type_map**) means that it's a necessary key
539549
| **model_devi_skip** | Integer | 0 | Number of structures skipped for fp in each MD
540550
| **model_devi_f_trust_lo** | Float | 0.05 | Lower bound of forces for the selection.
541551
| **model_devi_f_trust_hi** | Float | 0.15 | Upper bound of forces for the selection
542-
| **model_devi_e_trust_lo** | Float | 1e10 | Lower bound of energies for the selection. Recommend to set them a high number, since forces provide more precise information. Special cases such as energy minimization may need this. |
543-
| **model_devi_e_trust_hi** | Float | 1e10 | Upper bound of energies for the selection. |
552+
| **model_devi_v_trust_lo** | Float | 1e10 | Lower bound of virial for the selection. Should be used with DeePMD-kit v2.x |
553+
| **model_devi_v_trust_hi** | Float | 1e10 | Upper bound of virial for the selection. Should be used with DeePMD-kit v2.x |
554+
| model_devi_adapt_trust_lo | Boolean | False | Adaptively determines the lower trust levels of force and virial. This option should be used together with `model_devi_numb_candi_f`, `model_devi_numb_candi_v` and optionally with `model_devi_perc_candi_f` and `model_devi_perc_candi_v`. `dpgen` will make two sets: 1. From the frames with force model deviation lower than `model_devi_f_trust_hi`, select `max(model_devi_numb_candi_f, model_devi_perc_candi_f*n_frames)` frames with largest force model deviation. 2. From the frames with virial model deviation lower than `model_devi_v_trust_hi`, select `max(model_devi_numb_candi_v, model_devi_perc_candi_v*n_frames)` frames with largest virial model deviation. The union of the two sets is made as candidate dataset|
555+
| model_devi_numb_candi_f | Int | 10 | See `model_devi_adapt_trust_lo`.|
556+
| model_devi_numb_candi_v | Int | 0 | See `model_devi_adapt_trust_lo`.|
557+
| model_devi_perc_candi_f | Float | 0.0 | See `model_devi_adapt_trust_lo`.|
558+
| model_devi_perc_candi_v | Float | 0.0 | See `model_devi_adapt_trust_lo`.|
559+
| model_devi_f_avg_relative | Boolean | False | Normalized the force model deviations by the RMS force magnitude along the trajectory. This key should not be used with `use_relative`. |
544560
| **model_devi_clean_traj** | Boolean | true | Deciding whether to clean traj folders in MD since they are too large. |
545561
| **model_devi_nopbc** | Boolean | False | Assume open boundary condition in MD simulations. |
546562
| model_devi_activation_func | List of list of string | [["tanh","tanh"],["tanh","gelu"],["gelu","tanh"],["gelu","gelu"]] | Set activation functions for models, length of the List should be the same as `numb_models`, and two elements in the list of string respectively assign activation functions to the embedding and fitting nets within each model. *Backward compatibility*: the orginal "List of String" format is still supported, where embedding and fitting nets of one model use the same activation function, and the length of the List should be the same as `numb_models`|
@@ -1322,7 +1338,9 @@ mem_limit | Interger | 16 | Maximal memory permitted to apply for the job.
13221338
| # End of resources
13231339
| command | String | "lmp_serial" | Executable path of software, such as `lmp_serial`, `lmp_mpi` and `vasp_gpu`, `vasp_std`, etc.
13241340
| group_size | Integer | 5 | DP-GEN will put these jobs together in one submitting script.
1325-
1341+
| user_forward_files | List of str | ["/path_to/vdw_kernel.bindat"] | These files will be uploaded in each calculation task. You should make sure provide the path exists.
1342+
| user_backward_files | List of str | ["HILLS"] | Besides DP-GEN's normal output, these files will be downloaded after each calculation. You should make sure these files can be generated.
1343+
13261344
## Troubleshooting
13271345
1. The most common problem is whether two settings correspond with each other, including:
13281346
- The order of elements in `type_map` and `mass_map` and **`fp_pp_files`**.

conda/conda_build_config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
channel_sources:
2+
- defaults
3+
- conda-forge
4+
channel_targets:
5+
- deepmodeling

conda/construct.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% set version = os.popen('git describe --tags --abbrev=0').read().strip('\n').lstrip('v').replace('-', '_') %}
2+
3+
name: dpgen
4+
version: {{ version }}
5+
6+
channels:
7+
- defaults
8+
- conda-forge
9+
- deepmodeling
10+
11+
specs:
12+
- python 3.8
13+
- pip
14+
- dpgen {{ version }}
15+
16+
ignore_duplicate_files: True
17+
18+
license_file: ../LICENSE

conda/meta.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{% set name = "dpgen" %}
2+
{% set version = os.popen('git describe --tags --abbrev=0').read().strip('\n').lstrip('v').replace('-', '_') %}
3+
4+
package:
5+
name: {{ name|lower }}
6+
version: {{ version }}
7+
8+
source:
9+
path: ..
10+
11+
build:
12+
number: 0
13+
noarch: python
14+
script: python -m pip install --no-deps --ignore-installed .
15+
16+
requirements:
17+
build:
18+
- git
19+
host:
20+
- python >=3.6
21+
- pip
22+
- setuptools_scm
23+
- dargs
24+
- paramiko
25+
- requests
26+
- dpdata
27+
- dpdispatcher
28+
29+
run:
30+
- python >=3.6
31+
- dargs
32+
- paramiko
33+
- requests
34+
- dpdata
35+
- dpdispatcher
36+
- pymatgen
37+
38+
test:
39+
imports:
40+
- dpgen
41+
42+
about:
43+
home: https://github.com/deepmodeling/dpgen
44+
license: LGPL-3.0
45+
license_family: LGPL
46+
license_file: LICENSE
47+
doc_url: https://github.com/deepmodeling/dpgen
48+
dev_url: https://github.com/deepmodeling/dpgen
49+
50+
extra:
51+
recipe-maintainers:
52+
- felix5572

doc/CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# DP-GEN Contributing Guide
2+
Welcome to [DP-GEN](https://github.com/deepmodeling/dpgen/tree/master/dpgen) !
3+
4+
5+
## How to contribute
6+
DP-GEN adopts the same convention as other softwares in DeepModeling Community.
7+
You can first refer to DeePMD-kit's
8+
[Contributing guide](https://github.com/deepmodeling/deepmd-kit/edit/devel/CONTRIBUTING.md)
9+
and [Developer guide](https://github.com/deepmodeling/deepmd-kit/edit/devel/doc/development/index.md).
10+

dpgen/auto_test/common_equi.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
from dpgen.auto_test.calculator import make_calculator
1010
from dpgen.auto_test.mpdb import get_structure
1111
from dpgen.dispatcher.Dispatcher import make_dispatcher
12-
from dpgen.remote.decide_machine import decide_fp_machine, decide_model_devi_machine
1312
from distutils.version import LooseVersion
1413
from dpgen.dispatcher.Dispatcher import make_submission
15-
14+
from dpgen.remote.decide_machine import convert_mdata
1615
lammps_task_type = ['deepmd', 'meam', 'eam_fs', 'eam_alloy']
1716

1817

@@ -133,9 +132,9 @@ def run_equi(confs,
133132
inter_type = inter_param['type']
134133
# vasp
135134
if inter_type == "vasp":
136-
mdata = decide_fp_machine(mdata)
135+
mdata = convert_mdata(mdata, ["fp"])
137136
elif inter_type in lammps_task_type:
138-
mdata = decide_model_devi_machine(mdata)
137+
mdata = convert_mdata(mdata, ["model_devi"])
139138
else:
140139
raise RuntimeError("unknown task %s, something wrong" % inter_type)
141140

dpgen/auto_test/common_prop.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
from dpgen.auto_test.Vacancy import Vacancy
1414
from dpgen.auto_test.calculator import make_calculator
1515
from dpgen.dispatcher.Dispatcher import make_dispatcher
16-
from dpgen.remote.decide_machine import decide_fp_machine, decide_model_devi_machine
1716
from dpgen.dispatcher.Dispatcher import make_submission
18-
17+
from dpgen.remote.decide_machine import convert_mdata
1918
lammps_task_type = ['deepmd', 'meam', 'eam_fs', 'eam_alloy']
2019

2120

@@ -150,9 +149,9 @@ def run_property(confs,
150149
inter_type = inter_param_prop['type']
151150
# vasp
152151
if inter_type == "vasp":
153-
mdata = decide_fp_machine(mdata)
152+
mdata = convert_mdata(mdata, ["fp"])
154153
elif inter_type in lammps_task_type:
155-
mdata = decide_model_devi_machine(mdata)
154+
mdata = convert_mdata(mdata, ["model_devi"])
156155
else:
157156
raise RuntimeError("unknown task %s, something wrong" % inter_type)
158157

0 commit comments

Comments
 (0)