Skip to content

Commit fff9376

Browse files
committed
fix: make CH4 Lebesgue example self-contained
Replace one-line path stubs with usable JSON, POSCAR, INCAR, and documentation content. Add regression coverage that normalizes each JSON file and parses the bundled VASP inputs. Fixes #1915 Coding-Agent: Codex Codex-Version: codex-cli 0.149.0 Model: gpt-5.6-sol Reasoning-Effort: xhigh
1 parent d5ce577 commit fff9376

9 files changed

Lines changed: 430 additions & 8 deletions

File tree

examples/CH4-lebesgue/CH4.POSCAR

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
../init/CH4.POSCAR
1+
POSCAR file written by OVITO
2+
1.0000000000000000
3+
10.0000000000000000 0.0000000000000000 0.0000000000000000
4+
0.0000000000000000 10.0000000000000000 0.0000000000000000
5+
0.0000000000000000 0.0000000000000000 10.0000000000000000
6+
H C
7+
4 1
8+
Direct
9+
0.5381543385532134 0.4068608007477559 0.3605730142093164
10+
0.3945396557300829 0.4803205689390709 0.4384688400135213
11+
0.5520924283424902 0.5654502852627673 0.4427087377775140
12+
0.5281853047372259 0.4164147551778533 0.5391826568442692
13+
0.5032505926369848 0.4672551598725561 0.4452323411553799
14+
15+
0.00000000E+00 0.00000000E+00 0.00000000E+00
16+
0.00000000E+00 0.00000000E+00 0.00000000E+00
17+
0.00000000E+00 0.00000000E+00 0.00000000E+00
18+
0.00000000E+00 0.00000000E+00 0.00000000E+00
19+
0.00000000E+00 0.00000000E+00 0.00000000E+00
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
../run/dp1.x-lammps-vasp/CH4/INCAR_methane
1+
PREC=A
2+
ENCUT=400
3+
ISYM=0
4+
ALGO=Fast
5+
EDIFF=1.000000e-06
6+
LREAL=False
7+
NPAR=4
8+
KPAR=1
9+
NELM=120
10+
NELMIN=4
11+
ISIF=2
12+
ISMEAR=0
13+
SIGMA=0.20000
14+
IBRION=-1
15+
NSW=0
16+
LWAVE=F
17+
LCHARG=F
18+
PSTRESS=0
19+
KSPACING=0.500000
20+
KGAMMA=.FALSE.
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
../init/INCAR_methane.md
1+
PREC=A
2+
ENCUT=400
3+
ISYM=0
4+
ALGO=Fast
5+
EDIFF=1.000000e-06
6+
LREAL=False
7+
NPAR=4
8+
KPAR=1
9+
NELM=120
10+
NELMIN=4
11+
ISIF=2
12+
ISMEAR=0
13+
SIGMA=0.20000
14+
IBRION=0
15+
POTIM=0.5
16+
NSW=10
17+
LWAVE=F
18+
LCHARG=F
19+
PSTRESS=0
20+
KSPACING=0.500000
21+
KGAMMA=.FALSE.
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
../init/INCAR_methane.rlx
1+
PREC=A
2+
ENCUT=400
3+
ISYM=0
4+
ALGO=Fast
5+
EDIFF=1.000000e-06
6+
LREAL=False
7+
NPAR=4
8+
KPAR=1
9+
NELM=120
10+
NELMIN=4
11+
ISIF=2
12+
ISMEAR=0
13+
SIGMA=0.20000
14+
IBRION=2
15+
NSW=50
16+
LWAVE=F
17+
LCHARG=F
18+
PSTRESS=0
19+
KSPACING=0.500000
20+
KGAMMA=.FALSE.

examples/CH4-lebesgue/README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1-
../machine/DeePMD-kit-2.x/lebesgue_v2_machine_README.md
1+
# CH4 workflow on the Lebesgue platform
2+
3+
This directory is a self-contained methane example for preparing initial data
4+
and running DP-GEN with DeePMD-kit, LAMMPS, VASP, and the Lebesgue platform.
5+
6+
Before running the example:
7+
8+
1. provide `POTCAR_H` and `POTCAR_C` in this directory;
9+
1. replace the Lebesgue account placeholders in `lebesgue_v2_machine.json`;
10+
1. verify the program, image, and machine-type settings available to your
11+
Lebesgue account.
12+
13+
Generate the initial data with:
14+
15+
```bash
16+
dpgen init_bulk init.json lebesgue_v2_machine.json
17+
```
18+
19+
Then run the iterative workflow from the generated data directory with:
20+
21+
```bash
22+
dpgen run param_CH4_deepmd-kit-2.0.1.json lebesgue_v2_machine.json
23+
```
24+
25+
The machine configuration uses placeholder credentials and resource settings.
26+
Consult the current DPDispatcher Bohrium/Lebesgue documentation before
27+
submitting production jobs.

examples/CH4-lebesgue/init.json

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,36 @@
1-
../init/ch4.json
1+
{
2+
"stages": [
3+
1,
4+
2,
5+
3,
6+
4
7+
],
8+
"cell_type": "diamond",
9+
"super_cell": [
10+
1,
11+
1,
12+
1
13+
],
14+
"elements": [
15+
"H",
16+
"C"
17+
],
18+
"from_poscar": true,
19+
"from_poscar_path": "./CH4.POSCAR",
20+
"potcars": [
21+
"./POTCAR_H",
22+
"./POTCAR_C"
23+
],
24+
"relax_incar": "./INCAR_methane.rlx",
25+
"md_incar": "./INCAR_methane.md",
26+
"scale": [
27+
1.0
28+
],
29+
"skip_relax": false,
30+
"pert_numb": 30,
31+
"md_nstep": 10,
32+
"pert_box": 0.03,
33+
"pert_atom": 0.01,
34+
"coll_ndata": 5000,
35+
"_comment1": "that's all"
36+
}
Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,106 @@
1-
../machine/DeePMD-kit-2.x/lebesgue_v2_machine.json
1+
{
2+
"api_version": "1.0",
3+
"deepmd_version": "2.0.1",
4+
"train": {
5+
"command": "dp",
6+
"machine": {
7+
"batch_type": "DpCloudServer",
8+
"context_type": "DpCloudServerContext",
9+
"local_root": "./",
10+
"remote_profile": {
11+
"email": "your lebesgue register email",
12+
"password": "your lebesgue password",
13+
"program_id": 0,
14+
"input_data": {
15+
"api_version": 2,
16+
"job_type": "indicate",
17+
"log_file": "00*/train.log",
18+
"grouped": true,
19+
"job_name": "dpgen_train_job",
20+
"disk_size": 100,
21+
"scass_type": "c8_m60_1 * NVIDIA P100",
22+
"platform": "ali",
23+
"image_name": "deepmd-kit:2.0.1",
24+
"on_demand": 0
25+
}
26+
}
27+
},
28+
"resources": {
29+
"batch_type": "DpCloudServer",
30+
"number_node": 1,
31+
"cpu_per_node": 4,
32+
"gpu_per_node": 1,
33+
"queue_name": "GPU",
34+
"group_size": 1
35+
}
36+
},
37+
"model_devi": {
38+
"command": "lmp -i input.lammps -v restart 0",
39+
"machine": {
40+
"batch_type": "DpCloudServer",
41+
"context_type": "DpCloudServerContext",
42+
"local_root": "./",
43+
"remote_profile": {
44+
"email": "your lebesgue register email",
45+
"password": "your lebesgue password",
46+
"program_id": 0,
47+
"input_data": {
48+
"api_version": 2,
49+
"job_type": "indicate",
50+
"log_file": "*/model_devi.log",
51+
"grouped": true,
52+
"job_name": "dpgen_model_devi_job",
53+
"disk_size": 200,
54+
"scass_type": "c8_m60_1 * NVIDIA P100",
55+
"platform": "ali",
56+
"image_name": "deepmd-kit:2.0.1",
57+
"on_demand": 0
58+
}
59+
}
60+
},
61+
"resources": {
62+
"batch_type": "DpCloudServer",
63+
"number_node": 1,
64+
"cpu_per_node": 4,
65+
"gpu_per_node": 1,
66+
"queue_name": "GPU",
67+
"group_size": 5
68+
}
69+
},
70+
"fp": {
71+
"command": "mpirun -n 16 vasp_std",
72+
"machine": {
73+
"batch_type": "DpCloudServer",
74+
"context_type": "DpCloudServerContext",
75+
"local_root": "./",
76+
"remote_profile": {
77+
"email": "your lebesgue register email",
78+
"password": "your lebesgue password",
79+
"program_id": 0,
80+
"input_data": {
81+
"api_version": 2,
82+
"job_type": "indicate",
83+
"log_file": "task*/fp.log",
84+
"grouped": true,
85+
"job_name": "dpgen_fp_job",
86+
"disk_size": 100,
87+
"scass_type": "c8_m8_cpu",
88+
"platform": "ali",
89+
"image_name": "vasp:5.4.4",
90+
"on_demand": 0
91+
}
92+
}
93+
},
94+
"resources": {
95+
"batch_type": "DpCloudServer",
96+
"number_node": 1,
97+
"cpu_per_node": 32,
98+
"gpu_per_node": 0,
99+
"queue_name": "CPU",
100+
"group_size": 5,
101+
"source_list": [
102+
"/opt/intel/oneapi/setvars.sh"
103+
]
104+
}
105+
}
106+
}
Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,132 @@
1-
../run/dp2.x-lammps-vasp/param_CH4_deepmd-kit-2.0.1.json
1+
{
2+
"type_map": [
3+
"H",
4+
"C"
5+
],
6+
"mass_map": [
7+
1,
8+
12
9+
],
10+
"init_data_prefix": "./",
11+
"init_data_sys": [
12+
"CH4.POSCAR.01x01x01/02.md/sys-0004-0001/deepmd"
13+
],
14+
"sys_configs_prefix": "./",
15+
"sys_configs": [
16+
[
17+
"CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000*/POSCAR"
18+
],
19+
[
20+
"CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR"
21+
]
22+
],
23+
"_comment1": " that's all ",
24+
"numb_models": 4,
25+
"default_training_param": {
26+
"model": {
27+
"type_map": [
28+
"H",
29+
"C"
30+
],
31+
"descriptor": {
32+
"type": "se_a",
33+
"sel": [
34+
16,
35+
4
36+
],
37+
"rcut_smth": 0.5,
38+
"rcut": 5.0,
39+
"neuron": [
40+
120,
41+
120,
42+
120
43+
],
44+
"resnet_dt": true,
45+
"axis_neuron": 12,
46+
"seed": 1
47+
},
48+
"fitting_net": {
49+
"neuron": [
50+
25,
51+
50,
52+
100
53+
],
54+
"resnet_dt": false,
55+
"seed": 1
56+
}
57+
},
58+
"learning_rate": {
59+
"type": "exp",
60+
"start_lr": 0.001,
61+
"decay_steps": 100
62+
},
63+
"loss": {
64+
"start_pref_e": 0.02,
65+
"limit_pref_e": 2,
66+
"start_pref_f": 1000,
67+
"limit_pref_f": 1,
68+
"start_pref_v": 0.0,
69+
"limit_pref_v": 0.0
70+
},
71+
"training": {
72+
"numb_steps": 2000,
73+
"batch_size": 1,
74+
"disp_file": "lcurve.out",
75+
"disp_freq": 1000,
76+
"save_freq": 1000,
77+
"save_ckpt": "model.ckpt",
78+
"disp_training": true,
79+
"time_training": true,
80+
"profiling": false,
81+
"profiling_file": "timeline.json",
82+
"_comment2": "that's all"
83+
}
84+
},
85+
"model_devi_dt": 0.002,
86+
"model_devi_skip": 0,
87+
"model_devi_f_trust_lo": 0.05,
88+
"model_devi_f_trust_hi": 0.15,
89+
"model_devi_clean_traj": true,
90+
"model_devi_jobs": [
91+
{
92+
"sys_idx": [
93+
0
94+
],
95+
"temps": [
96+
100
97+
],
98+
"press": [
99+
1.0
100+
],
101+
"trj_freq": 10,
102+
"nsteps": 300,
103+
"ensemble": "nvt",
104+
"_idx": "00"
105+
},
106+
{
107+
"sys_idx": [
108+
1
109+
],
110+
"temps": [
111+
100
112+
],
113+
"press": [
114+
1.0
115+
],
116+
"trj_freq": 10,
117+
"nsteps": 3000,
118+
"ensemble": "nvt",
119+
"_idx": "01"
120+
}
121+
],
122+
"fp_style": "vasp",
123+
"shuffle_poscar": false,
124+
"fp_task_max": 20,
125+
"fp_task_min": 5,
126+
"fp_pp_path": "./",
127+
"fp_pp_files": [
128+
"POTCAR_H",
129+
"POTCAR_C"
130+
],
131+
"fp_incar": "./INCAR_methane"
132+
}

0 commit comments

Comments
 (0)