Skip to content

[Refactor] Rename module_base to source_base #6306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ set(ABACUS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source)
set(ABACUS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
set(ABACUS_BIN_PATH ${CMAKE_CURRENT_BINARY_DIR}/${ABACUS_BIN_NAME})
include_directories(${ABACUS_SOURCE_DIR})
include_directories(${ABACUS_SOURCE_DIR}/module_base/module_container)
include_directories(${ABACUS_SOURCE_DIR}/source_base/module_container)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The source code of ABACUS is based on several modules. Under the ABACUS root dir
For those who are interested in the source code, the following figure shows the structure of the source code.

```text
|-- module_base A basic module including
|-- source_base A basic module including
| | (1) Mathematical library interface functions: BLAS, LAPACK, Scalapack;
| | (2) Custom data classes: matrix, vector definitions and related functions;
| | (3) Parallelization functions: MPI, OpenMP;
Expand Down Expand Up @@ -183,7 +183,7 @@ pre-commit install

## Adding a unit test

We use [GoogleTest](https://github.com/google/googletest) as our test framework. Write your test under the corresponding module folder at `abacus-develop/tests`, then append the test to `tests/CMakeLists.txt`. If there are currently no unit tests provided for the module, do as follows. `module_base` provides a simple demonstration.
We use [GoogleTest](https://github.com/google/googletest) as our test framework. Write your test under the corresponding module folder at `abacus-develop/tests`, then append the test to `tests/CMakeLists.txt`. If there are currently no unit tests provided for the module, do as follows. `source_base` provides a simple demonstration.

- Add a folder named `test` under the module.
- Append the content below to `CMakeLists.txt` of the module:
Expand Down
6 changes: 3 additions & 3 deletions python/pyabacus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ find_package(pybind11 CONFIG REQUIRED)

# set source path
set(ABACUS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../source")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/module_base")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/source_base")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/module_basis/module_nao")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/source_hsolver")
set(PSI_PATH "${ABACUS_SOURCE_DIR}/module_psi")
Expand Down Expand Up @@ -69,14 +69,14 @@ endif()
include_directories(
${BASE_PATH}
${ABACUS_SOURCE_DIR}
${ABACUS_SOURCE_DIR}/module_base/module_container
${ABACUS_SOURCE_DIR}/source_base/module_container
)

# add basic libraries
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# add base
set(BASE_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/base")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_base ${BASE_BINARY_DIR})
add_subdirectory(${ABACUS_SOURCE_DIR}/source_base ${BASE_BINARY_DIR})
# add parameter
set(PARAMETER_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/parameter")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_parameter ${PARAMETER_BINARY_DIR})
Expand Down
6 changes: 3 additions & 3 deletions python/pyabacus/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ find_package(pybind11 CONFIG REQUIRED)
```cmake
# Set source path
set(ABACUS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../source")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/module_base")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/source_base")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/module_basis/module_nao")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/source_hsolver")
set(PSI_PATH "${ABACUS_SOURCE_DIR}/module_psi")
Expand Down Expand Up @@ -131,7 +131,7 @@ endif()
include_directories(
${BASE_PATH}
${ABACUS_SOURCE_DIR}
${ABACUS_SOURCE_DIR}/module_base/module_container
${ABACUS_SOURCE_DIR}/source_base/module_container
)
```
- This section adds the necessary include directories for the project.
Expand All @@ -141,7 +141,7 @@ include_directories(
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Add base
set(BASE_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/base")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_base ${BASE_BINARY_DIR})
add_subdirectory(${ABACUS_SOURCE_DIR}/source_base ${BASE_BINARY_DIR})
# Add parameter
set(PARAMETER_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/parameter")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_parameter ${PARAMETER_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/examples/indexmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _index_map(ntype, natom, lmax, nzeta=None):

0, 1, -1, 2, -2, 3, -3, ..., l, -l

(see module_base/ylm.cpp and module_base/math_ylmreal.cpp
(see source_base/ylm.cpp and source_base/math_ylmreal.cpp
for details)

'''
Expand Down
4 changes: 2 additions & 2 deletions python/pyabacus/src/ModuleBase/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
list(APPEND pymodule_base
list(APPEND pysource_base
${PROJECT_SOURCE_DIR}/src/ModuleBase/py_base_math.cpp
${BASE_PATH}/kernels/math_ylm_op.cpp
${BASE_PATH}/kernels/math_kernel_op.cpp
Expand All @@ -7,7 +7,7 @@ list(APPEND pymodule_base
${BASE_PATH}/module_device/device.cpp
)

pybind11_add_module(_base_pack MODULE ${pymodule_base})
pybind11_add_module(_base_pack MODULE ${pysource_base})

target_link_libraries(_base_pack
PRIVATE
Expand Down
6 changes: 3 additions & 3 deletions python/pyabacus/src/ModuleBase/py_base_math.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>

#include "module_base/math_sphbes.h"
#include "module_base/math_integral.h"
#include "module_base/spherical_bessel_transformer.h"
#include "source_base/math_sphbes.h"
#include "source_base/math_integral.h"
#include "source_base/spherical_bessel_transformer.h"

namespace py = pybind11;
using namespace pybind11::literals;
Expand Down
10 changes: 5 additions & 5 deletions python/pyabacus/src/ModuleNAO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ list(APPEND _naos
${NAO_PATH}/two_center_integrator.cpp
${NAO_PATH}/two_center_table.cpp
# dependency
${ABACUS_SOURCE_DIR}/module_base/kernels/math_ylm_op.cpp
${ABACUS_SOURCE_DIR}/module_base/kernels/math_kernel_op.cpp
${ABACUS_SOURCE_DIR}/module_base/kernels/math_kernel_op_vec.cpp
${ABACUS_SOURCE_DIR}/source_base/kernels/math_ylm_op.cpp
${ABACUS_SOURCE_DIR}/source_base/kernels/math_kernel_op.cpp
${ABACUS_SOURCE_DIR}/source_base/kernels/math_kernel_op_vec.cpp
# ${ABACUS_SOURCE_DIR}/module_psi/kernels/psi_memory_op.cpp
${ABACUS_SOURCE_DIR}/module_base/module_device/memory_op.cpp
${ABACUS_SOURCE_DIR}/module_base/module_device/device.cpp
${ABACUS_SOURCE_DIR}/source_base/module_device/memory_op.cpp
${ABACUS_SOURCE_DIR}/source_base/module_device/device.cpp
)
add_library(naopack SHARED
${_naos}
Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/src/ModuleNAO/py_m_nao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "module_base/vector3.h"
#include "source_base/vector3.h"
#include "module_basis/module_nao/radial_collection.h"
#include "module_basis/module_nao/two_center_integrator.h"

Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/src/hsolver/py_diago_cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <ATen/core/tensor_types.h>

#include "source_hsolver/diago_cg.h"
#include "module_base/module_device/memory_op.h"
#include "source_base/module_device/memory_op.h"

namespace py = pybind11;

Expand Down
4 changes: 2 additions & 2 deletions python/pyabacus/src/hsolver/py_hsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <pybind11/numpy.h>

#include "source_hsolver/diago_dav_subspace.h"
#include "module_base/kernels/math_kernel_op.h"
#include "module_base/module_device/types.h"
#include "source_base/kernels/math_kernel_op.h"
#include "source_base/module_device/types.h"

#include "./py_diago_dav_subspace.hpp"
#include "./py_diago_david.hpp"
Expand Down
30 changes: 15 additions & 15 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_subdirectory(module_base)
add_subdirectory(source_base)
add_subdirectory(module_cell)
add_subdirectory(module_psi)
add_subdirectory(module_elecstate)
Expand Down Expand Up @@ -42,17 +42,17 @@ list(APPEND device_srcs
# module_psi/kernels/psi_memory_op.cpp
# module_psi/kernels/device.cpp

module_base/module_device/device.cpp
module_base/module_device/memory_op.cpp
module_base/kernels/math_kernel_op.cpp
module_base/kernels/math_kernel_op_vec.cpp
source_base/module_device/device.cpp
source_base/module_device/memory_op.cpp
source_base/kernels/math_kernel_op.cpp
source_base/kernels/math_kernel_op_vec.cpp

module_hamilt_pw/hamilt_pwdft/kernels/force_op.cpp
module_hamilt_pw/hamilt_pwdft/kernels/stress_op.cpp
module_hamilt_pw/hamilt_pwdft/kernels/onsite_op.cpp
module_hamilt_pw/hamilt_pwdft/kernels/wf_op.cpp
module_hamilt_pw/hamilt_pwdft/kernels/vnl_op.cpp
module_base/kernels/math_ylm_op.cpp
source_base/kernels/math_ylm_op.cpp
module_hamilt_general/module_xc/kernels/xc_functional_op.cpp
)

Expand All @@ -70,15 +70,15 @@ if(USE_CUDA)
module_elecstate/kernels/cuda/elecstate_op.cu

# module_psi/kernels/cuda/memory_op.cu
module_base/module_device/cuda/memory_op.cu
source_base/module_device/cuda/memory_op.cu

module_hamilt_pw/hamilt_pwdft/kernels/cuda/force_op.cu
module_hamilt_pw/hamilt_pwdft/kernels/cuda/stress_op.cu
module_hamilt_pw/hamilt_pwdft/kernels/cuda/wf_op.cu
module_hamilt_pw/hamilt_pwdft/kernels/cuda/vnl_op.cu
module_base/kernels/cuda/math_ylm_op.cu
module_base/kernels/cuda/math_kernel_op.cu
module_base/kernels/cuda/math_kernel_op_vec.cu
source_base/kernels/cuda/math_ylm_op.cu
source_base/kernels/cuda/math_kernel_op.cu
source_base/kernels/cuda/math_kernel_op_vec.cu
module_hamilt_general/module_xc/kernels/cuda/xc_functional_op.cu
)
endif()
Expand All @@ -97,22 +97,22 @@ if(USE_ROCM)
module_elecstate/kernels/rocm/elecstate_op.hip.cu

# module_psi/kernels/rocm/memory_op.hip.cu
module_base/module_device/rocm/memory_op.hip.cu
source_base/module_device/rocm/memory_op.hip.cu

module_hamilt_pw/hamilt_pwdft/kernels/rocm/force_op.hip.cu
module_hamilt_pw/hamilt_pwdft/kernels/rocm/stress_op.hip.cu
module_hamilt_pw/hamilt_pwdft/kernels/rocm/wf_op.hip.cu
module_hamilt_pw/hamilt_pwdft/kernels/rocm/vnl_op.hip.cu
module_base/kernels/rocm/math_kernel_op.hip.cu
module_base/kernels/rocm/math_kernel_op_vec.hip.cu
module_base/kernels/rocm/math_ylm_op.hip.cu
source_base/kernels/rocm/math_kernel_op.hip.cu
source_base/kernels/rocm/math_kernel_op_vec.hip.cu
source_base/kernels/rocm/math_ylm_op.hip.cu
module_hamilt_general/module_xc/kernels/rocm/xc_functional_op.hip.cu
)
endif()

if(USE_DSP)
list(APPEND device_srcs
module_base/kernels/dsp/dsp_connector.cpp
source_base/kernels/dsp/dsp_connector.cpp
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include Makefile.vars
# Compiler information
#==========================

INCLUDES = -I. -Isource_main -Isource_main/commands -Icommands -I../ -Imodule_base/module_container
INCLUDES = -I. -Isource_main -Isource_main/commands -Icommands -I../ -Isource_base/module_container

LIBS = -lm -lpthread
OPTS = -std=c++14 -pedantic -m64 ${INCLUDES}
Expand Down
16 changes: 8 additions & 8 deletions source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ VPATH=./src_global:\
./module_cell/module_neighbor:\
./module_cell/module_symmetry:\
./module_cell:\
./module_base:\
./module_base/kernels:\
./module_base/module_container/base/core:\
./module_base/module_container/ATen/core:\
./module_base/module_container/ATen/kernels:\
./module_base/module_container/ATen/ops:\
./module_base/module_device:\
./module_base/module_mixing:\
./source_base:\
./source_base/kernels:\
./source_base/module_container/base/core:\
./source_base/module_container/ATen/core:\
./source_base/module_container/ATen/kernels:\
./source_base/module_container/ATen/ops:\
./source_base/module_device:\
./source_base/module_mixing:\
./module_md:\
./module_basis/module_pw:\
./module_basis/module_pw/module_fft:\
Expand Down
4 changes: 2 additions & 2 deletions source/module_basis/module_ao/ORB_atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <string>

#include "module_base/intarray.h"
#include "module_base/vector3.h"
#include "source_base/intarray.h"
#include "source_base/vector3.h"
#include "ORB_atomic_lm.h"

class Numerical_Orbital_AtomRelation
Expand Down
14 changes: 7 additions & 7 deletions source/module_basis/module_ao/ORB_atomic_lm.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "ORB_atomic_lm.h"
#include "module_base/sph_bessel_recursive.h"
#include "source_base/sph_bessel_recursive.h"
#include "module_parameter/parameter.h"
#include "module_base/blas_connector.h"
#include "module_base/timer.h"
#include "module_base/math_integral.h"
#include "module_base/math_sphbes.h"
#include "module_base/constants.h"
#include "source_base/blas_connector.h"
#include "source_base/timer.h"
#include "source_base/math_integral.h"
#include "source_base/math_sphbes.h"
#include "source_base/constants.h"

#ifdef _OPENMP
#include <omp.h>
Expand Down Expand Up @@ -216,7 +216,7 @@ void Numerical_Orbital_Lm::copy_parameter(
this->kcut = (nk-1) * this->dk;
}

#include "module_base/mathzone_add1.h"
#include "source_base/mathzone_add1.h"
void Numerical_Orbital_Lm::extra_uniform(const double &dr_uniform_in, const bool &force_flag)
{
ModuleBase::timer::tick("NOrbital_Lm", "extra_uniform");
Expand Down
4 changes: 2 additions & 2 deletions source/module_basis/module_ao/ORB_atomic_lm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include <vector>
using std::vector;
#include "module_base/global_function.h"
#include "module_base/global_variable.h"
#include "source_base/global_function.h"
#include "source_base/global_variable.h"

/**
* CLASS Num_orbital_lm
Expand Down
14 changes: 7 additions & 7 deletions source/module_basis/module_ao/ORB_gaunt_table.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <math.h>
#include <cassert>
#include "ORB_gaunt_table.h"
#include "module_base/timer.h"
#include "module_base/memory.h"
#include "module_base/mathzone.h"
#include "module_base/global_function.h"
#include "module_base/vector3.h"
#include "module_base/constants.h"
#include "module_base/math_ylmreal.h"
#include "source_base/timer.h"
#include "source_base/memory.h"
#include "source_base/mathzone.h"
#include "source_base/global_function.h"
#include "source_base/vector3.h"
#include "source_base/constants.h"
#include "source_base/math_ylmreal.h"

ORB_gaunt_table::ORB_gaunt_table(){}
ORB_gaunt_table::~ORB_gaunt_table(){}
Expand Down
4 changes: 2 additions & 2 deletions source/module_basis/module_ao/ORB_gaunt_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define ORB_GAUNT_TABLE_H

#include <map>
#include "module_base/realarray.h"
#include "module_base/matrix.h"
#include "source_base/realarray.h"
#include "source_base/matrix.h"

class ORB_gaunt_table
{
Expand Down
2 changes: 1 addition & 1 deletion source/module_basis/module_ao/ORB_nonlocal.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ORB_nonlocal.h"
#include "module_base/global_function.h"
#include "source_base/global_function.h"

Numerical_Nonlocal::Numerical_Nonlocal()
{
Expand Down
4 changes: 2 additions & 2 deletions source/module_basis/module_ao/ORB_nonlocal.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef NUMERICAL_NONLOCAL_H
#define NUMERICAL_NONLOCAL_H

#include "module_base/complexarray.h"
#include "module_base/complexmatrix.h"
#include "source_base/complexarray.h"
#include "source_base/complexmatrix.h"
#include "ORB_nonlocal_lm.h"
/**
* \class Numerical_Nonlocal
Expand Down
14 changes: 7 additions & 7 deletions source/module_basis/module_ao/ORB_nonlocal_lm.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "ORB_nonlocal_lm.h"

#include "module_base/constants.h"
#include "module_base/global_function.h"
#include "module_base/math_integral.h"
#include "module_base/math_polyint.h"
#include "module_base/math_sphbes.h"
#include "module_base/mathzone.h" /// use Polynomial_Interpolation_xy, Spherical_Bessel
#include "module_base/mathzone_add1.h" /// use SplineD2
#include "source_base/constants.h"
#include "source_base/global_function.h"
#include "source_base/math_integral.h"
#include "source_base/math_polyint.h"
#include "source_base/math_sphbes.h"
#include "source_base/mathzone.h" /// use Polynomial_Interpolation_xy, Spherical_Bessel
#include "source_base/mathzone_add1.h" /// use SplineD2
#include "module_parameter/parameter.h"

#include <cassert>
Expand Down
Loading
Loading