Skip to content

Commit 0f79c05

Browse files
authored
refactor: move parallel_2d to module_base (#5625)
* move parallel_2d to module_base * fix test * fix --------- Co-authored-by: root <pxlxingliang>
1 parent df7e8a5 commit 0f79c05

File tree

38 files changed

+356
-224
lines changed

38 files changed

+356
-224
lines changed

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,8 @@ else()
421421
include_directories(${FFTW3_INCLUDE_DIRS})
422422
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
423423

424-
if(ENABLE_LCAO)
425-
find_package(ScaLAPACK REQUIRED)
426-
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
427-
endif()
424+
find_package(ScaLAPACK REQUIRED)
425+
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
428426

429427
if(USE_OPENMP)
430428
list(APPEND math_libs FFTW3::FFTW3_OMP)

source/Makefile.Objects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ OBJS_BASE=abfs-vector3_order.o\
170170
broyden_mixing.o\
171171
memory_op.o\
172172
device.o\
173+
parallel_2d.o\
173174

174175
OBJS_CELL=atom_pseudo.o\
175176
atom_spec.o\
@@ -378,7 +379,6 @@ OBJS_ORBITAL=ORB_atomic.o\
378379
ORB_nonlocal.o\
379380
ORB_nonlocal_lm.o\
380381
ORB_read.o\
381-
parallel_2d.o\
382382
parallel_orbitals.o\
383383
atomic_radials.o\
384384
hydrogen_radials.o\

source/module_base/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ add_library(
5353
parallel_device.cpp
5454
spherical_bessel_transformer.cpp
5555
cubic_spline.cpp
56+
parallel_2d.cpp
5657
module_mixing/mixing_data.cpp
5758
module_mixing/mixing.cpp
5859
module_mixing/plain_mixing.cpp
File renamed without changes.
File renamed without changes.

source/module_base/test_parallel/CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,20 @@ add_test(NAME base_parallel_reduce_test
3434
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
3535
)
3636

37-
if(ENABLE_LCAO)
37+
AddTest(
38+
TARGET parallel_2d_test
39+
SOURCES parallel_2d_test.cpp ../parallel_2d.cpp
40+
LIBS parameter ${math_libs}
41+
)
42+
43+
install(FILES parallel_2d_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
44+
find_program(BASH bash)
45+
add_test(NAME parallel_2d_test_para
46+
COMMAND ${BASH} parallel_2d_test.sh
47+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
48+
)
49+
50+
3851
# figure out the lib that provides BLACS
3952
if(MKLROOT)
4053
list(APPEND BLACS_LIB MKL::MKL MKL::MKL_SCALAPACK)
@@ -52,4 +65,4 @@ if(ENABLE_LCAO)
5265
COMMAND ${BASH} blacs_connector_test.sh
5366
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
5467
)
55-
endif()
68+

source/module_basis/module_ao/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ if(ENABLE_LCAO)
88
ORB_nonlocal.cpp
99
ORB_nonlocal_lm.cpp
1010
ORB_read.cpp
11-
parallel_2d.cpp
1211
parallel_orbitals.cpp
1312
)
1413

source/module_basis/module_ao/parallel_orbitals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _PARALLEL_ORBITALS_H_
22
#define _PARALLEL_ORBITALS_H_
3-
#include "parallel_2d.h"
3+
#include "module_base/parallel_2d.h"
44
#include <fstream>
55

66
/// This class packs the information of 2D-block-cyclic for LCAO code:

0 commit comments

Comments
 (0)