Skip to content

Commit d09959b

Browse files
committed
Merge branch 'develop' of https://github.com/deepmodeling/abacus-develop into planewave
2 parents 50c86c0 + 6733619 commit d09959b

File tree

773 files changed

+45957
-27234
lines changed

Some content is hidden

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

773 files changed

+45957
-27234
lines changed

.clang-format

Lines changed: 34 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,38 @@
11
---
2-
Language: Cpp
3-
# BasedOnStyle: LLVM
4-
AccessModifierOffset: -2
2+
BasedOnStyle: Microsoft
3+
AccessModifierOffset: '-2'
54
AlignAfterOpenBracket: Align
6-
AlignConsecutiveMacros: None
7-
AlignConsecutiveAssignments: None
8-
AlignConsecutiveBitFields: None
9-
AlignConsecutiveDeclarations: None
10-
AlignEscapedNewlines: Right
11-
AlignOperands: Align
12-
AlignTrailingComments: true
13-
AllowAllArgumentsOnNextLine: true
14-
AllowAllConstructorInitializersOnNextLine: true
15-
AllowAllParametersOfDeclarationOnNextLine: true
16-
AllowShortEnumsOnASingleLine: true
17-
AllowShortBlocksOnASingleLine: Never
18-
AllowShortCaseLabelsOnASingleLine: false
19-
AllowShortFunctionsOnASingleLine: All
20-
AllowShortLambdasOnASingleLine: All
21-
AllowShortIfStatementsOnASingleLine: Never
22-
AllowShortLoopsOnASingleLine: false
23-
AlwaysBreakAfterDefinitionReturnType: None
24-
AlwaysBreakAfterReturnType: None
25-
AlwaysBreakBeforeMultilineStrings: false
26-
AlwaysBreakTemplateDeclarations: MultiLine
27-
AttributeMacros:
28-
- __capability
29-
BinPackArguments: true
30-
BinPackParameters: true
31-
BraceWrapping:
32-
AfterCaseLabel: false
33-
AfterClass: false
34-
AfterControlStatement: Never
35-
AfterEnum: false
36-
AfterFunction: false
37-
AfterNamespace: false
38-
AfterObjCDeclaration: false
39-
AfterStruct: false
40-
AfterUnion: false
41-
AfterExternBlock: false
42-
BeforeCatch: false
43-
BeforeElse: false
44-
BeforeLambdaBody: false
45-
BeforeWhile: false
46-
IndentBraces: false
47-
SplitEmptyFunction: true
48-
SplitEmptyRecord: true
49-
SplitEmptyNamespace: true
50-
BreakBeforeBinaryOperators: None
51-
BreakBeforeConceptDeclarations: true
52-
BreakBeforeBraces: Attach
53-
BreakBeforeInheritanceComma: false
54-
BreakInheritanceList: BeforeColon
55-
BreakBeforeTernaryOperators: true
56-
BreakConstructorInitializersBeforeComma: false
57-
BreakConstructorInitializers: BeforeColon
58-
BreakAfterJavaFieldAnnotations: false
59-
BreakStringLiterals: true
60-
ColumnLimit: 80
61-
CommentPragmas: '^ IWYU pragma:'
62-
CompactNamespaces: false
63-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
64-
ConstructorInitializerIndentWidth: 4
65-
ContinuationIndentWidth: 4
66-
Cpp11BracedListStyle: true
67-
DeriveLineEnding: true
68-
DerivePointerAlignment: false
69-
DisableFormat: false
70-
EmptyLineBeforeAccessModifier: LogicalBlock
71-
ExperimentalAutoDetectBinPacking: false
72-
FixNamespaceComments: true
73-
ForEachMacros:
74-
- foreach
75-
- Q_FOREACH
76-
- BOOST_FOREACH
77-
StatementAttributeLikeMacros:
78-
- Q_EMIT
79-
IncludeBlocks: Preserve
80-
IncludeCategories:
81-
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
82-
Priority: 2
83-
SortPriority: 0
84-
CaseSensitive: false
85-
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
86-
Priority: 3
87-
SortPriority: 0
88-
CaseSensitive: false
89-
- Regex: '.*'
90-
Priority: 1
91-
SortPriority: 0
92-
CaseSensitive: false
93-
IncludeIsMainRegex: '(Test)?$'
94-
IncludeIsMainSourceRegex: ''
95-
IndentCaseLabels: false
96-
IndentCaseBlocks: false
97-
IndentGotoLabels: true
98-
IndentPPDirectives: None
99-
IndentExternBlock: AfterExternBlock
100-
IndentRequires: false
101-
IndentWidth: 4
102-
IndentWrappedFunctionNames: false
103-
InsertTrailingCommas: None
104-
JavaScriptQuotes: Leave
105-
JavaScriptWrapImports: true
106-
KeepEmptyLinesAtTheStartOfBlocks: true
107-
MacroBlockBegin: ''
108-
MacroBlockEnd: ''
109-
MaxEmptyLinesToKeep: 1
110-
NamespaceIndentation: None
111-
ObjCBinPackProtocolList: Auto
112-
ObjCBlockIndentWidth: 2
113-
ObjCBreakBeforeNestedBlockParam: true
114-
ObjCSpaceAfterProperty: false
115-
ObjCSpaceBeforeProtocolList: true
116-
PenaltyBreakAssignment: 2
117-
PenaltyBreakBeforeFirstCallParameter: 19
118-
PenaltyBreakComment: 300
119-
PenaltyBreakFirstLessLess: 120
120-
PenaltyBreakString: 1000
121-
PenaltyBreakTemplateDeclaration: 10
122-
PenaltyExcessCharacter: 1000000
123-
PenaltyReturnTypeOnItsOwnLine: 60
124-
PenaltyIndentedWhitespace: 0
5+
AlignConsecutiveMacros: 'true'
6+
AlignEscapedNewlines: Left
7+
AlignOperands: 'true'
8+
AlignTrailingComments: 'false'
9+
AllowAllArgumentsOnNextLine: 'false'
10+
AllowAllParametersOfDeclarationOnNextLine: 'false'
11+
BinPackArguments: 'false'
12+
BinPackParameters: 'false'
13+
BreakBeforeBinaryOperators: All
14+
BreakBeforeTernaryOperators: 'true'
15+
Cpp11BracedListStyle: 'true'
16+
DerivePointerAlignment: 'true'
17+
FixNamespaceComments: 'true'
18+
IncludeBlocks: Regroup
19+
IndentWidth: '4'
20+
Language: Cpp
12521
PointerAlignment: Right
126-
ReflowComments: true
127-
SortIncludes: true
128-
SortJavaStaticImport: Before
129-
SortUsingDeclarations: true
130-
SpaceAfterCStyleCast: false
131-
SpaceAfterLogicalNot: false
132-
SpaceAfterTemplateKeyword: true
133-
SpaceBeforeAssignmentOperators: true
134-
SpaceBeforeCaseColon: false
135-
SpaceBeforeCpp11BracedList: false
136-
SpaceBeforeCtorInitializerColon: true
137-
SpaceBeforeInheritanceColon: true
138-
SpaceBeforeParens: ControlStatements
139-
SpaceAroundPointerQualifiers: Default
140-
SpaceBeforeRangeBasedForLoopColon: true
141-
SpaceInEmptyBlock: false
142-
SpaceInEmptyParentheses: false
143-
SpacesBeforeTrailingComments: 1
144-
SpacesInAngles: false
145-
SpacesInConditionalStatement: false
146-
SpacesInContainerLiterals: true
147-
SpacesInCStyleCastParentheses: false
148-
SpacesInParentheses: false
149-
SpacesInSquareBrackets: false
150-
SpaceBeforeSquareBrackets: false
151-
BitFieldColonSpacing: Both
152-
Standard: Latest
153-
StatementMacros:
154-
- Q_UNUSED
155-
- QT_REQUIRE_VERSION
156-
TabWidth: 8
157-
UseCRLF: false
158-
UseTab: Never
159-
WhitespaceSensitiveMacros:
160-
- STRINGIZE
161-
- PP_STRINGIZE
162-
- BOOST_PP_STRINGIZE
163-
- NS_SWIFT_NAME
164-
- CF_SWIFT_NAME
165-
...
22+
ReflowComments: 'true'
23+
SortIncludes: 'true'
24+
SortUsingDeclarations: 'true'
25+
SpaceAfterCStyleCast: 'false'
26+
SpaceAfterLogicalNot: 'false'
27+
SpaceBeforeRangeBasedForLoopColon: 'false'
28+
SpaceInEmptyParentheses: 'false'
29+
SpacesInAngles: 'false'
30+
SpacesInCStyleCastParentheses: 'false'
31+
SpacesInContainerLiterals: 'false'
32+
SpacesInParentheses: 'false'
33+
SpacesInSquareBrackets: 'false'
34+
Standard: Cpp11
35+
TabWidth: '4'
36+
UseTab: ForContinuationAndIndentation
16637

38+
...

.devcontainer/devcontainer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
// For format details, see https://aka.ms/devcontainer.json.
1+
// To develop inside a pre-configured container, see https://code.visualstudio.com/docs/remote/containers .
2+
// For format details, see https://aka.ms/devcontainer.json .
23
{
34
"image":"ghcr.io/deepmodeling/abacus-development-kit:gnu",
4-
"extensions": ["ms-vscode.cpptools-extension-pack"]
5-
}
5+
"extensions": [
6+
"ms-vscode.cpptools-extension-pack",
7+
"xaver.clang-format",
8+
"cschlosser.doxdocgen"
9+
]
10+
}

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
root = true
22

33
[*]
4-
indent_style = space
4+
indent_style = tab
55
indent_size = 4
66
charset = utf-8
77
end_of_line = lf

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
pull_request_target:
55
branches:
66
- develop
7-
- reconstruction
8-
- newelpa
9-
7+
- update_MD
8+
- ABACUS_2.2.0_beta
9+
- deepks
10+
- planewave
1011
jobs:
1112

1213
start-runner:

.gitpod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# https://www.gitpod.io/docs/configure
2+
image: "ghcr.io/deepmodeling/abacus-development-kit:gnu"

.readthedocs.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ version: 2
77

88
# Build documentation in the docs/ directory with Sphinx
99
sphinx:
10-
configuration: ABACUS.develop/source/module_orbital/1_Documents/sphinx/source/conf.py
10+
configuration: source/module_deepks/sphinx/source/conf.py
11+
# configuration: source/module_orbital/1_Documents/sphinx/source/conf.py
1112

1213
# Optionally build your docs in additional formats such as PDF
1314
formats:
@@ -17,4 +18,4 @@ formats:
1718
python:
1819
version: 3.7
1920
install:
20-
- requirements: ABACUS.develop/source/module_orbital/1_Documents/sphinx/requirements.txt
21+
- requirements: source/module_orbital/1_Documents/sphinx/requirements.txt

CMakeLists.txt

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if(USE_OPENMP)
4747
find_package(OpenMP REQUIRED)
4848
target_link_libraries(${ABACUS_BIN_NAME} OpenMP::OpenMP_CXX)
4949
add_compile_options(${OpenMP_CXX_FLAGS})
50-
add_compile_definitions(__OPENMP)
50+
#add_compile_definitions(_OPENMP)
5151
endif()
5252

5353
set(CMAKE_CXX_STANDARD 11)
@@ -114,10 +114,20 @@ if(MKLROOT)
114114
find_package(IntelMKL REQUIRED)
115115
add_definitions(-D__MKL -DMKL_ILP64)
116116
include_directories(${MKL_INCLUDE_DIRS} ${MKL_INCLUDE_DIRS}/fftw)
117-
target_link_libraries(${ABACUS_BIN_NAME}
118-
-lifcore
119-
IntelMKL::MKL
120-
)
117+
118+
# Since libtorch will find its own MKL, the fftw part conflicts with the original one.
119+
# When enable deepks, mkl will be linked within ${TORCH_LIBRARIES}.
120+
if(ENABLE_DEEPKS)
121+
target_link_libraries(${ABACUS_BIN_NAME}
122+
-lifcore
123+
# IntelMKL::MKL
124+
)
125+
else()
126+
target_link_libraries(${ABACUS_BIN_NAME}
127+
-lifcore
128+
IntelMKL::MKL
129+
)
130+
endif()
121131
else()
122132
find_package(FFTW3 REQUIRED)
123133
find_package(LAPACK REQUIRED)
@@ -135,7 +145,7 @@ if(ENABLE_DEEPKS)
135145
find_package(Torch REQUIRED)
136146
include_directories(${TORCH_INCLUDE_DIRS})
137147
target_link_libraries(${ABACUS_BIN_NAME} ${TORCH_LIBRARIES})
138-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
148+
add_compile_options(${TORCH_CXX_FLAGS})
139149

140150
find_path(libnpy_SOURCE_DIR
141151
npy.hpp
@@ -149,7 +159,7 @@ if(ENABLE_DEEPKS)
149159
)
150160
FetchContent_MakeAvailable(libnpy)
151161
endif()
152-
include_directories(${libnpy_SOURCE_DIR})
162+
include_directories(${libnpy_SOURCE_DIR}/include)
153163
add_compile_definitions(__DEEPKS)
154164
endif()
155165

Dockerfile.gnu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ RUN cd /tmp \
3939
&& cd /tmp && rm -rf fftw-3.3.9 && rm fftw-3.3.9.tar.gz
4040

4141
RUN cd /tmp \
42-
&& wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-1.9.0%2Bcpu.zip --no-check-certificate --quiet \
43-
&& unzip libtorch-shared-with-deps-1.9.0+cpu.zip \
42+
&& wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip --no-check-certificate --quiet \
43+
&& unzip libtorch-cxx11-abi-shared-with-deps-1.9.1+cpu.zip \
4444
&& cp -r libtorch/include /usr/local \
4545
&& cp -r libtorch/lib /usr/local \
4646
&& cp -r libtorch/share /usr/local \

0 commit comments

Comments
 (0)