Skip to content

Commit 05425e6

Browse files
committed
example: add dpgen autotest example
1 parent 0752886 commit 05425e6

File tree

9 files changed

+8391
-3
lines changed

9 files changed

+8391
-3
lines changed

docs/examples/dpgen.md

Lines changed: 187 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
[back to main page](../../README.md)
44

5-
[DP-GEN](https://github.com/deepmodeling/dpgen), the deep potential generator, is a package designed to generate deep learning based model of interatomic potential energy and force fields (Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and Weinan E, DP-GEN: A concurrent learning platform for the generation of reliable deep learning based potential energy models, Computer Physics Communications, 2020, 107206). ABACUS can now interface with DP-GEN to generate deep potentials. In the following, we take the FCC aluminum as an example.
5+
[DP-GEN](https://github.com/deepmodeling/dpgen), the deep potential generator, is a package designed to generate deep learning based model of interatomic potential energy and force fields (Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and Weinan E, DP-GEN: A concurrent learning platform for the generation of reliable deep learning based potential energy models, Computer Physics Communications, 2020, 107206). ABACUS can now interface with DP-GEN to generate deep potentials and performe autotests. In the following, we take the FCC aluminum as an example.
6+
7+
## init_bulk and run
68

79
This example can be found in examples/dpgen-example/init_and_run directory.
810

@@ -11,7 +13,7 @@ Firstly, one needs to prepare input files for ABACUS calculation, e.g., “INPUT
1113
Secondly, for the "dpgen init_bulk" step, an `init.json` file should be provided:
1214

1315

14-
```
16+
```json
1517
{
1618
"init_fp_style": "ABACUS", # abacus interface
1719
"stages": [1,2,3,4],
@@ -36,7 +38,7 @@ Secondly, for the "dpgen init_bulk" step, an `init.json` file should be provided
3638
```
3739

3840
Next, for the "dpgen run" step, the following `run_param.json` should be provided.
39-
```
41+
```json
4042
{
4143
"type_map": [
4244
"Al"
@@ -181,6 +183,188 @@ Next, for the "dpgen run" step, the following `run_param.json` should be provide
181183
}
182184
```
183185

186+
## autotest
187+
188+
This example can be found in examples/dpgen-example/autotest directory.
189+
190+
`dpgen autotest` supports to perform `relaxation`,`eos` (equation of state),`elastic`,`surface`,`vacancy`, and `interstitial` calculations with ABACUS. A `property.json` and `machine.json` file need to be provided. For example,
191+
192+
`property.json`:
193+
```json
194+
195+
{
196+
"structures": ["confs/"],
197+
"interaction": {
198+
"type": "abacus",
199+
"incar": "./INPUT",
200+
"potcar_prefix":"./",
201+
"potcars": {"Al": "Al.PD04.PBE.UPF"},
202+
"orb_files": {"Al":"Al_gga_10au_100Ry_3s3p2d.orb"}
203+
},
204+
"_relaxation": {
205+
"cal_type": "relaxation",
206+
"cal_setting":{
207+
"input_prop": "./INPUT.rlx"
208+
}
209+
},
210+
"properties": [
211+
{
212+
"type": "eos",
213+
"vol_start": 0.85,
214+
"vol_end": 1.15,
215+
"vol_step": 0.01,
216+
"cal_setting": {
217+
"relax_pos": true,
218+
"relax_shape": true,
219+
"relax_vol": false,
220+
"overwrite_interaction":{
221+
"type": "abacus",
222+
"incar": "./INPUT",
223+
"potcar_prefix":"./",
224+
"orb_files": {"Al":"Al_gga_10au_100Ry_3s3p2d.orb"},
225+
"potcars": {"Al": "Al.PD04.PBE.UPF"} }
226+
}
227+
},
228+
{
229+
"type": "elastic",
230+
"skip": false,
231+
"norm_deform": 1e-2,
232+
"shear_deform": 1e-2
233+
},
234+
{
235+
"type": "vacancy",
236+
"skip": false,
237+
"supercell": [2, 2, 2]
238+
},
239+
{
240+
"type": "surface",
241+
"skip": true,
242+
"min_slab_size": 15,
243+
"min_vacuum_size":11,
244+
"pert_xz": 0.01,
245+
"max_miller": 3,
246+
"cal_type": "static"
247+
}
248+
]
249+
}
250+
```
251+
252+
`machine.json`
253+
254+
```json
255+
{
256+
"api_version": "1.0",
257+
"deepmd_version": "2.1.0",
258+
"train" :[
259+
{
260+
"command": "dp",
261+
"machine": {
262+
"batch_type": "DpCloudServer",
263+
"context_type": "DpCloudServerContext",
264+
"local_root" : "./",
265+
"remote_profile":{
266+
"email": "[email protected]",
267+
"password": "xxx",
268+
"program_id": 000,
269+
"input_data":{
270+
"api_version":2,
271+
"job_type": "indicate",
272+
"log_file": "00*/train.log",
273+
"grouped":true,
274+
"job_name": "Al-train-VASP",
275+
"disk_size": 100,
276+
"scass_type":"c8_m32_1 * NVIDIA V100",
277+
"platform": "ali",
278+
"image_name":"LBG_DeePMD-kit_2.1.0_v1",
279+
"on_demand":0
280+
}
281+
}
282+
},
283+
"resources": {
284+
"number_node":123473334635,
285+
"local_root":"./",
286+
"cpu_per_node": 4,
287+
"gpu_per_node": 1,
288+
"queue_name": "GPU",
289+
"group_size": 1
290+
}
291+
}],
292+
"model_devi":
293+
[{
294+
"command": "lmp -i input.lammps -v restart 0",
295+
"machine": {
296+
"batch_type": "DpCloudServer",
297+
"context_type": "DpCloudServerContext",
298+
"local_root" : "./",
299+
"remote_profile":{
300+
"email": "[email protected]",
301+
"password": "xxx",
302+
"program_id": 000,
303+
"input_data":{
304+
"api_version":2,
305+
"job_type": "indicate",
306+
"log_file": "*/model_devi.log",
307+
"grouped":true,
308+
"job_name": "Al-devia-ABACUS",
309+
"disk_size": 200,
310+
"scass_type":"c8_m32_1 * NVIDIA V100",
311+
"platform": "ali",
312+
"image_name":"LBG_DeePMD-kit_2.1.0_v1",
313+
"on_demand":0
314+
}
315+
}
316+
},
317+
"resources": {
318+
"number_node": 28348383,
319+
"local_root":"./",
320+
"cpu_per_node": 4,
321+
"gpu_per_node": 1,
322+
"queue_name": "GPU",
323+
"group_size": 100
324+
}
325+
}],
326+
"fp":
327+
[{
328+
"command": "OMP_NUM_THREADS=1 mpirun -np 16 abacus",
329+
"machine": {
330+
"batch_type": "DpCloudServer",
331+
"context_type": "DpCloudServerContext",
332+
"local_root" : "./",
333+
"remote_profile":{
334+
"email": "[email protected]",
335+
"password": "xxx",
336+
"program_id": 000,
337+
"input_data":{
338+
"api_version":2,
339+
"job_type": "indicate",
340+
"log_file": "task*/fp.log",
341+
"grouped":true,
342+
"job_name": "al-DFT-test",
343+
"disk_size": 100,
344+
"scass_type":"c32_m128_cpu",
345+
"platform": "ali",
346+
"image_name":"XXXXX",
347+
"on_demand":0
348+
}
349+
}
350+
},
351+
"resources": {
352+
"number_node": 712254638889,
353+
"cpu_per_node": 32,
354+
"gpu_per_node": 0,
355+
"queue_name": "CPU",
356+
"group_size": 2,
357+
"local_root":"./",
358+
"source_list": ["/opt/intel/oneapi/setvars.sh"]
359+
}
360+
}
361+
]
362+
}
363+
364+
```
365+
366+
For each property, the command `dpgen autotest make property.json` will generate the input files, `dpgen autotest run property.json machine.json` will run the corresponding tasks, and `dpgen autotest post property.json` will collect the final results.
367+
184368

185369
Notes:
186370
- The ABACUS-DPGEN interface can be used in both pw and lcao basis.

0 commit comments

Comments
 (0)