Skip to content

Commit 3b2c162

Browse files
authored
Refactor: delete paw code, will add back the paw code with a better plan. (#6225)
* delete USE_PAW code * delete use_paw * update * remove ENABLE_PAW * update
1 parent f158182 commit 3b2c162

File tree

122 files changed

+181
-633610
lines changed

Some content is hidden

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

122 files changed

+181
-633610
lines changed

.github/workflows/build_test_cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: "Build with Intel toolchain"
1818

1919
- tag: gnu
20-
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1 -DENABLE_PAW=1"
20+
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1"
2121
name: "Build extra components with GNU toolchain"
2222
- tag: intel
2323
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1"

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
apt update && apt install -y lcov gpg curl jq ca-certificates
1919
- name: Building
2020
run: |
21-
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
21+
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
2222
cmake --build build -j`nproc`
2323
cmake --install build
2424
- name: Testing

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Configure
3333
run: |
34-
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_MLKEDF=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DENABLE_FLOAT_FFTW=ON
34+
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_MLKEDF=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DENABLE_FLOAT_FFTW=ON
3535
3636
# Temporarily removed because no one maintains this now.
3737
# And it will break the CI test workflow.

CMakeLists.txt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ option(INFO "Enable gathering math library information" OFF)
3737
option(ENABLE_COVERAGE "Enable coverage build" OFF)
3838
option(GIT_SUBMODULE "Check submodules during build" ON)
3939

40-
option(ENABLE_PAW "Enable PAW method" OFF)
41-
4240
# Do not enable it if generated code will run on different CPUs
4341
option(ENABLE_NATIVE_OPTIMIZATION
4442
"Enable compilation optimization for the native machine's CPU type" OFF)
@@ -611,18 +609,7 @@ if(ENABLE_LIBCOMM)
611609
include_directories(${LIBCOMM_DIR}/include)
612610
endif()
613611

614-
if(ENABLE_PAW)
615-
if(LIBPAW_DIR)
616-
add_subdirectory(${LIBPAW_DIR})
617-
elseif(GIT_SUBMODULE)
618-
git_submodule_update()
619-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/libpaw_interface)
620-
else()
621-
message(FATAL_ERROR "Must provide LIBPAW_DIR for PAW related features.")
622-
endif()
623-
target_link_libraries(${ABACUS_BIN_NAME} paw)
624-
add_compile_definitions(USE_PAW)
625-
endif()
612+
626613

627614
list(APPEND math_libs m)
628615
target_link_libraries(${ABACUS_BIN_NAME} ${math_libs})

source/module_cell/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
add_subdirectory(module_symmetry)
22
add_subdirectory(module_neighbor)
3-
if(ENABLE_PAW)
4-
add_subdirectory(module_paw)
5-
endif()
63

74
add_library(
85
cell

source/module_cell/cal_atoms_info.h

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,28 @@ class CalAtomsInfo
3030
GlobalV::ofs_running << " The readin total magnetization is " << para.inp.nupdown << std::endl;
3131
}
3232

33-
if (!para.inp.use_paw)
33+
34+
// decide whether to be USPP
35+
for (int it = 0; it < ntype; ++it)
3436
{
35-
// decide whether to be USPP
36-
for (int it = 0; it < ntype; ++it)
37+
if (atoms[it].ncpp.tvanp)
3738
{
38-
if (atoms[it].ncpp.tvanp)
39-
{
40-
para.sys.use_uspp = true;
41-
}
39+
para.sys.use_uspp = true;
4240
}
43-
44-
// calculate the total number of local basis
45-
para.sys.nlocal = 0;
46-
for (int it = 0; it < ntype; ++it)
41+
}
42+
43+
// calculate the total number of local basis
44+
para.sys.nlocal = 0;
45+
for (int it = 0; it < ntype; ++it)
46+
{
47+
const int nlocal_it = atoms[it].nw * atoms[it].na;
48+
if (para.inp.nspin != 4)
4749
{
48-
const int nlocal_it = atoms[it].nw * atoms[it].na;
49-
if (para.inp.nspin != 4)
50-
{
51-
para.sys.nlocal += nlocal_it;
52-
}
53-
else
54-
{
55-
para.sys.nlocal += nlocal_it * 2; // zhengdy-soc
56-
}
50+
para.sys.nlocal += nlocal_it;
51+
}
52+
else
53+
{
54+
para.sys.nlocal += nlocal_it * 2; // zhengdy-soc
5755
}
5856
}
5957

source/module_cell/klist.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
#include "module_hamilt_pw/hamilt_pwdft/global.h"
1010
#include "module_io/berryphase.h"
1111
#include "module_parameter/parameter.h"
12-
#ifdef USE_PAW
13-
#include "module_cell/module_paw/paw_cell.h"
14-
#endif
1512

1613
void K_Vectors::cal_ik_global()
1714
{
@@ -168,10 +165,6 @@ void K_Vectors::set(const UnitCell& ucell,
168165

169166
// std::cout << " NUMBER OF K-POINTS : " << nkstot << std::endl;
170167

171-
#ifdef USE_PAW
172-
GlobalC::paw_cell.set_isk(nks, isk.data());
173-
#endif
174-
175168
return;
176169
}
177170

source/module_cell/module_paw/CMakeLists.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

source/module_cell/module_paw/paw_atom.cpp

Lines changed: 0 additions & 149 deletions
This file was deleted.

source/module_cell/module_paw/paw_atom.h

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)