Skip to content

Commit 26c44c3

Browse files
authored
Merge pull request #179 from deepmodeling/develop
Merge: v2.3.4 updates
2 parents 6b041e9 + e69de05 commit 26c44c3

File tree

193 files changed

+10606
-1954
lines changed

Some content is hidden

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

193 files changed

+10606
-1954
lines changed

CMakeLists.txt

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ option(USE_OPENMP " Enable OpenMP in abacus." ON)
2020
option(ENABLE_ASAN "Enable AddressSanitizer" OFF)
2121
option(BUILD_TESTING "Build ABACUS unit tests" OFF)
2222
option(GENERATE_TEST_REPORTS "Enable test report generation" OFF)
23+
option(INFO "Enable gathering of math library information" OFF)
2324

2425
set(ABACUS_BIN_NAME abacus)
2526
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/modules)
@@ -217,7 +218,7 @@ if(ENABLE_DEEPKS)
217218
HINTS ${libnpy_INCLUDE_DIR}
218219
)
219220
if(NOT libnpy_SOURCE_DIR)
220-
include(FetchContent)
221+
include(FetchContent)
221222
FetchContent_Declare(
222223
libnpy
223224
GIT_REPOSITORY https://github.com/llohse/libnpy.git
@@ -237,14 +238,22 @@ if(DEFINED Libxc_DIR)
237238
set(ENABLE_LIBXC ON)
238239
endif()
239240
if(ENABLE_LIBXC)
240-
find_package(Libxc)
241+
find_package(Libxc HINTS ${Libxc_DIR}/share/cmake/Libxc)
241242
if(${Libxc_FOUND})
242243
message("Using Libxc.")
243244
add_compile_definitions(USE_LIBXC)
244245
target_link_libraries(${ABACUS_BIN_NAME} Libxc::xc)
245246
include_directories(${Libxc_INCLUDE_DIRS})
246247
else()
247-
message(WARNING "Will not use Libxc.")
248+
include(FetchContent)
249+
FetchContent_Declare(
250+
Libxc
251+
GIT_REPOSITORY https://gitlab.com/libxc/libxc.git
252+
GIT_TAG "5.2.3"
253+
GIT_SHALLOW TRUE
254+
GIT_PROGRESS TRUE
255+
)
256+
FetchContent_MakeAvailable(Libxc)
248257
endif()
249258
endif()
250259

@@ -261,6 +270,12 @@ add_compile_definitions(
261270
TEST_EXX_RADIAL=1
262271
)
263272

273+
if(INFO)
274+
message(STATUS "Will gather math lib info.")
275+
add_compile_definitions(GATHER_INFO)
276+
# modifications on blas_connector and lapack_connector
277+
endif()
278+
264279
IF (BUILD_TESTING)
265280
set(CMAKE_CXX_STANDARD 14) # Required in orbital
266281
include(CTest)
@@ -310,7 +325,7 @@ target_link_libraries(${ABACUS_BIN_NAME}
310325
neighbor
311326
orb
312327
io
313-
ions
328+
relax
314329
lcao
315330
gint
316331
parallel
@@ -319,7 +334,7 @@ target_link_libraries(${ABACUS_BIN_NAME}
319334
pw
320335
ri
321336
driver
322-
xc
337+
xc_
323338
hsolver
324339
elecstate
325340
hamilt

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.

docs/input-main.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
- [Variables useful for debugging](#variables-useful-for-debugging)
7070

71-
[nurse](#nurse) | [t_in_h](#t_in_h) | [vl_in_h](#vl_in_h) | [vnl_in_h](#vnl_in_h) | [test_force](#test_force) | [test_stress](#test_stress) | [colour](#colour) | [test_just_neighbor](#test_just_neighbor)
71+
[nurse](#nurse) | [t_in_h](#t_in_h) | [vl_in_h](#vl_in_h) | [vnl_in_h](#vnl_in_h) | [test_force](#test_force) | [test_stress](#test_stress) | [colour](#colour)
7272

7373
- [DeePKS](#deepks)
7474

@@ -148,6 +148,9 @@ This part of variables are used to control general system parameters.
148148
- *md*: molecular dynamics
149149
- *sto-scf*: do self-consistent electronic structure calculation with [stochastic DFT](#electronic-structure-sdft)
150150
- *sto-md*: molecular dynamics with [stochastic DFT](#electronic-structure-sdft)
151+
- *test_memory* : checks memory required for the calculation. The number is not quite reliable, please use with care
152+
- *test_neighbour* : only performs neighbouring atom search
153+
- *gen_jle* : generates projectors for DeePKS; see also deepks_lmax_descriptor
151154

152155
> Note: *istate* and *ienvelope* only work for LCAO basis set and are not working right now.
153156
- **Default**: scf
@@ -597,9 +600,9 @@ This part of variables are used to control the parameters of stochastic DFT (SDF
597600
- **Description**:
598601
- Different method to do SDFT.
599602
- 1: SDFT calculates $T_n(\hat{h})\ket{\chi}$ twice, where $T_n(x)$ is the n-th order Chebyshev polynomial and $\hat{h}=\frac{\hat{H}-\bar{E}}{\Delta E}$ owning eigen-value $\in(-1,1)$. This method cost less memory but slow.
600-
- 2: SDFT calculates $T_n(\hat{h})\ket{\chi}$ once but need much more memory. This method is fast but when memory is not enough, only method 1 can be used.
601-
- other: use 1
602-
- **Default**: 1
603+
- 2: SDFT calculates $T_n(\hat{h})\ket{\chi}$ once but need much more memory. This method is much faster. Besides, it calculate $N_e$ with $\bra{\chi}\sqrt{\hat f}\sqrt{\hat f}\ket{\chi}$, which needs smaller [nche_sto](#nche_sto). However, when memory is not enough, only method 1 can be used.
604+
- other: use 2
605+
- **Default**: 2
603606
604607
#### nbands_sto
605608
@@ -642,6 +645,12 @@ This part of variables are used to control the parameters of stochastic DFT (SDF
642645
- **Description**: Frequency (once each initsto_freq steps) to generate new stochastic orbitals when running md.
643646
- **Default**:1000
644647
648+
#### npart_sto
649+
650+
- **Type**: Integer
651+
- **Description**: Make memory cost to 1/npart_sto times of previous one when running post process of SDFT like DOS with method_sto = 2.
652+
- **Default**:1
653+
645654
### Geometry relaxation
646655
647656
This part of variables are used to control the geometry relaxation.
@@ -963,8 +972,8 @@ Warning: this function is not robust enough for the current version. Please try
963972
#### deepks_descriptor_lmax
964973
965974
- **Type**: Integer
966-
- **Description**: control the max angular momentum of descriptor basis.
967-
- **Default**: 0
975+
- **Description**: when generating projectors, this variable controls the max angular momentum of descriptor basis.
976+
- **Default**: 2
968977
969978
#### deepks_scf
970979
@@ -1597,12 +1606,6 @@ This part of variables are used to control berry phase and wannier90 interfacae
15971606
- **Description**: If set to 1, output to terminal will have some color.
15981607
- **Default**: 0
15991608
1600-
#### test_just_neighbor
1601-
1602-
- **Type**: Boolean
1603-
- **Description**: If set to 1, then only perform the neighboring atoms search.
1604-
- **Default**: 0
1605-
16061609
### Electronic conductivities
16071610
16081611
Frequency-dependent electronic conductivities can be calculated with Kubo-Greenwood formula[Phys. Rev. B 83, 235120 (2011)].

0 commit comments

Comments
 (0)