Skip to content

Commit 01c30c6

Browse files
authored
Merge branch 'develop' into feature/container-blas-and-lapack
2 parents 999c5ed + 46bc1a4 commit 01c30c6

Some content is hidden

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

61 files changed

+858
-794
lines changed

CMakeLists.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,6 @@ if (USE_SW)
286286
include_directories(${SW_FFT}/include)
287287

288288
target_link_libraries(${ABACUS_BIN_NAME} ${SW_FFT}/lib/libfftw3.a)
289-
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswfft.a)
290-
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswscalapack.a)
291-
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswlapack.a)
292-
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswblas.a)
293289
endif()
294290

295291
find_package(Threads REQUIRED)
@@ -470,10 +466,7 @@ if(MKLROOT)
470466
if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
471467
list(APPEND math_libs ifcore)
472468
endif()
473-
elseif(USE_SW)
474-
list(APPEND math_libs gfortran)
475-
# SW architecture can only use its own math library
476-
else()
469+
elseif(NOT USE_SW)
477470
find_package(FFTW3 REQUIRED)
478471
find_package(Lapack REQUIRED)
479472
include_directories(${FFTW3_INCLUDE_DIRS})
@@ -796,11 +789,22 @@ if(ENABLE_RAPIDJSON)
796789
target_link_libraries(${ABACUS_BIN_NAME} json_output)
797790
endif()
798791

792+
if (USE_SW)
793+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswfft.a)
794+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswscalapack.a)
795+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswlapack.a)
796+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswblas.a)
797+
list(APPEND math_libs gfortran)
798+
endif()
799+
800+
list(APPEND math_libs m)
801+
target_link_libraries(${ABACUS_BIN_NAME} ${math_libs})
802+
799803
install(PROGRAMS ${ABACUS_BIN_PATH}
800804
TYPE BIN
801805
# DESTINATION ${CMAKE_INSTALL_BINDIR}
802806
)
803807

804808
if(ENABLE_COVERAGE)
805809
coverage_evaluate()
806-
endif()
810+
endif()

Dockerfile.intel

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ FROM ubuntu:22.04
22

33
RUN apt-get update && apt-get install -y \
44
bc cmake git gnupg gcc g++ python3-numpy sudo wget vim unzip \
5-
libcereal-dev libxc-dev libgtest-dev libgmock-dev libbenchmark-dev
5+
libcereal-dev libxc-dev libgtest-dev libgmock-dev libbenchmark-dev \
6+
pkg-config build-essential autoconf automake libtool
67

78
# Following steps by https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/apt.html .
89
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
@@ -16,21 +17,44 @@ RUN apt-get update && \
1617
intel-oneapi-compiler-dpcpp-cpp \
1718
intel-oneapi-compiler-fortran \
1819
intel-oneapi-mkl-devel \
19-
intel-oneapi-mpi-devel="2021.11.*" \
20+
intel-oneapi-mkl-sycl-devel \
21+
intel-oneapi-mkl-sycl-distributed-dft-devel \
22+
intel-oneapi-mpi-devel \
2023
intel-oneapi-vtune && \
21-
rm /opt/intel/oneapi/mpi/latest && ln -s /opt/intel/oneapi/mpi/2021.11 /opt/intel/oneapi/mpi/latest
22-
ENV I_MPI_ROOT=/opt/intel/oneapi/mpi/latest \
23-
LIBRARY_PATH=/opt/intel/oneapi/tbb/latest/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/latest/lib:/opt/intel/oneapi/mkl/latest/lib/:/opt/intel/oneapi/ippcp/latest/lib/:/opt/intel/oneapi/ipp/latest/lib:/opt/intel/oneapi/dpl/latest/lib:/opt/intel/oneapi/dnnl/latest/lib:/opt/intel/oneapi/dal/latest/lib:/opt/intel/oneapi/compiler/latest/lib:/opt/intel/oneapi/ccl/latest/lib/ \
24-
LD_LIBRARY_PATH=/opt/intel/oneapi/tbb/latest/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/latest/opt/mpi/libfabric/lib:/opt/intel/oneapi/mpi/latest/lib:/opt/intel/oneapi/mkl/latest/lib:/opt/intel/oneapi/itac/latest/slib:/opt/intel/oneapi/ippcp/latest/lib/:/opt/intel/oneapi/ipp/latest/lib:/opt/intel/oneapi/dpl/latest/lib:/opt/intel/oneapi/dnnl/latest/lib:/opt/intel/oneapi/debugger/latest/opt/debugger/lib:/opt/intel/oneapi/dal/latest/lib:/opt/intel/oneapi/compiler/latest/opt/oclfpga/host/linux64/lib:/opt/intel/oneapi/compiler/latest/opt/compiler/lib:/opt/intel/oneapi/compiler/latest/lib:/opt/intel/oneapi/ccl/latest/lib/ \
25-
PATH=/opt/intel/oneapi/vtune/latest/bin64:/opt/intel/oneapi/mpi/latest/opt/mpi/libfabric/bin:/opt/intel/oneapi/mpi/latest/bin:/opt/intel/oneapi/mkl/latest/bin/:/opt/intel/oneapi/itac/latest/bin:/opt/intel/oneapi/inspector/latest/bin64:/opt/intel/oneapi/dpcpp-ct/latest/bin:/opt/intel/oneapi/dev-utilities/latest/bin:/opt/intel/oneapi/debugger/latest/opt/debugger/bin:/opt/intel/oneapi/compiler/latest/opt/oclfpga/bin:/opt/intel/oneapi/compiler/latest/bin:/opt/intel/oneapi/advisor/latest/bin64:/opt/mamba/bin:/opt/mamba/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
26-
MKLROOT=/opt/intel/oneapi/mkl/latest \
27-
FI_PROVIDER_PATH=/opt/intel/oneapi/mpi/latest/opt/mpi/libfabric/lib/prov:/usr/lib/x86_64-linux-gnu/libfabric \
28-
CMAKE_PREFIX_PATH=/opt/intel/oneapi/tbb/latest/env/..:/opt/intel/oneapi/mkl/latest/lib/cmake:/opt/intel/oneapi/ipp/latest/lib/cmake/ipp:/opt/intel/oneapi/dpl/latest/lib/cmake/oneDPL:/opt/intel/oneapi/dnnl/latest/lib/cmake:/opt/intel/oneapi/dal/latest:/opt/intel/oneapi/compiler/latest \
29-
CMPLR_ROOT=/opt/intel/oneapi/compiler/latest
24+
apt-get clean && \
25+
rm -rf /var/lib/apt/lists/*
26+
27+
RUN ls -la /opt/intel/oneapi/mkl/latest/lib/intel64/*sycl*dft*
28+
RUN ls -la /opt/intel/oneapi/mkl/latest/lib/intel64/*dis*
29+
30+
# Set oneAPI environment variables
31+
ENV ONEAPI_ROOT=/opt/intel/oneapi
32+
ENV I_MPI_ROOT=${ONEAPI_ROOT}/mpi/latest
33+
ENV MKLROOT=${ONEAPI_ROOT}/mkl/latest
34+
ENV CMPLR_ROOT=${ONEAPI_ROOT}/compiler/latest
35+
36+
# Set library paths and include paths
37+
ENV LIBRARY_PATH=${ONEAPI_ROOT}/tbb/latest/lib/intel64/gcc4.8:${ONEAPI_ROOT}/mpi/latest/lib:${MKLROOT}/lib/intel64:${ONEAPI_ROOT}/compiler/latest/lib/:${LIBRARY_PATH}
38+
ENV LD_LIBRARY_PATH=${ONEAPI_ROOT}/tbb/latest/lib/intel64/gcc4.8:${ONEAPI_ROOT}/mpi/latest/lib:${MKLROOT}/lib/intel64:${ONEAPI_ROOT}/compiler/latest/lib/:${LD_LIBRARY_PATH}
39+
ENV PATH=${ONEAPI_ROOT}/vtune/latest/bin64:${ONEAPI_ROOT}/mpi/latest/bin:${MKLROOT}/bin/intel64:${ONEAPI_ROOT}/compiler/latest/bin:${PATH}
40+
ENV CPATH=${MKLROOT}/include:${ONEAPI_ROOT}/mpi/latest/include:${CPATH}
41+
ENV PKG_CONFIG_PATH=${MKLROOT}/lib/pkgconfig:${ONEAPI_ROOT}/mpi/latest/lib/pkgconfig:${PKG_CONFIG_PATH}
42+
43+
# Set CMAKE related paths
44+
ENV CMAKE_PREFIX_PATH=${ONEAPI_ROOT}/tbb/latest:${MKLROOT}/lib/cmake:${ONEAPI_ROOT}/dpl/latest/lib/cmake:${ONEAPI_ROOT}/dnnl/latest/lib/cmake:${ONEAPI_ROOT}/dal/latest:${ONEAPI_ROOT}/compiler/latest:${CMAKE_PREFIX_PATH}
3045

3146
SHELL ["/bin/bash", "-c"]
3247
ENV CC=mpiicx CXX=mpiicpx FC=mpiifx
3348

49+
# Verify oneAPI installation
50+
RUN source ${ONEAPI_ROOT}/setvars.sh && \
51+
echo "=== Verify compiler ===" && \
52+
which mpiicx && mpiicx --version && \
53+
echo "=== Verify MKL ===" && \
54+
ls ${MKLROOT}/lib/intel64/ && \
55+
echo "=== Verify MPI ===" && \
56+
which mpirun && mpirun --version
57+
3458
# https://elpa.mpcdf.mpg.de/software/tarball-archive/ELPA_TARBALL_ARCHIVE.html
3559
RUN source /opt/intel/oneapi/setvars.sh && \
3660
cd /tmp && \
@@ -39,28 +63,34 @@ RUN source /opt/intel/oneapi/setvars.sh && \
3963
tar xzf elpa-$ELPA_VER.tar.gz && rm elpa-$ELPA_VER.tar.gz && \
4064
cd elpa-$ELPA_VER && mkdir build && cd build && \
4165
../configure CFLAGS="-O3 -march=native" FCFLAGS="-O3 -qmkl=cluster" --enable-openmp && \
42-
make -j`nproc` && \
66+
make -j$(nproc) && \
4367
make PREFIX=/usr/local install && \
4468
ln -s /usr/local/include/elpa_openmp-$ELPA_VER/elpa /usr/local/include/ && \
4569
cd /tmp && rm -rf elpa-$ELPA_VER
4670

47-
RUN cd /tmp && git clone https://github.com/Tencent/rapidjson.git && cp -r rapidjson/include/rapidjson /usr/include/ \
48-
&& rm -rf rapidjson
49-
50-
RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcpu.zip \
51-
--no-check-certificate --quiet -O libtorch.zip && \
52-
unzip -q libtorch.zip -d /opt && rm libtorch.zip
53-
54-
ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake
71+
# rapidjson and libtorch
72+
RUN cd /tmp && git clone --depth 1 https://github.com/Tencent/rapidjson.git && cp -r rapidjson/include/rapidjson /usr/include/ && rm -rf rapidjson
73+
RUN wget -q https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcpu.zip -O /tmp/libtorch.zip && \
74+
unzip -q /tmp/libtorch.zip -d /opt && rm -f /tmp/libtorch.zip
75+
ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake:${CMAKE_PREFIX_PATH}
5576

77+
# Clone and build abacus (optional during image build; keep for CI image)
5678
ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/develop /dev/null
57-
58-
RUN source /opt/intel/oneapi/setvars.sh && \
59-
git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
79+
RUN export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU32_DIST_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH} && \
80+
export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU32_DIST_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH} && \
81+
cd /tmp && git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
6082
cd abacus-develop && \
61-
cmake -B build -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
62-
cmake --build build -j`nproc` && \
83+
cmake -B build \
84+
-DENABLE_MLALGO=ON \
85+
-DENABLE_LIBXC=ON \
86+
-DENABLE_LIBRI=ON \
87+
-DENABLE_RAPIDJSON=ON \
88+
-DCMAKE_BUILD_TYPE=Release && \
89+
cmake --build build -j"$(nproc)" && \
6390
cmake --install build && \
64-
rm -rf build && \
65-
abacus --version
66-
#&& rm -rf abacus-develop
91+
(/usr/local/bin/abacus --version || echo "ABACUS installed but version check failed") && \
92+
rm -rf /tmp/abacus-develop
93+
# -DMKL_SYCL=OFF \
94+
# -DMKL_SYCL_DISTRIBUTED_DFT:BOOL=OFF \
95+
# Default entry
96+
CMD ["/bin/bash"]

cmake/FindMKL.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# MKL_INCLUDE - where to find mkl.h, etc.
55
# MKL_FOUND - True if mkl found.
66

7-
find_package(MKL NO_MODULE) # try using official module first
7+
# find_package(MKL NO_MODULE) # try using official module first
88
if(NOT TARGET MKL::MKL)
99

1010
find_path(MKL_INCLUDE mkl_service.h HINTS ${MKLROOT}/include)
@@ -70,7 +70,9 @@ if(MKL_FOUND)
7070
set_property(TARGET MKL::MKL PROPERTY
7171
INTERFACE_LINK_LIBRARIES
7272
"-Wl,--start-group"
73-
MKL::INTEL MKL::INTEL_THREAD MKL::CORE)
73+
MKL::INTEL MKL::INTEL_THREAD MKL::CORE
74+
"-Wl,--end-group"
75+
)
7476
endif()
7577
endif()
7678

source/Makefile.Objects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ OBJS_LCAO=evolve_elec.o\
643643
LCAO_init_basis.o\
644644
setup_exx.o\
645645
setup_deepks.o\
646+
setup_dm.o\
646647
rho_tau_lcao.o\
647648
center2_orb.o\
648649
center2_orb-orb11.o\

source/source_base/test_parallel/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ add_test(NAME MODULE_BASE_parallel_2d_test_para
6767

6868
# figure out the lib that provides BLACS
6969
if(MKLROOT)
70-
list(APPEND BLACS_LIB MKL::MKL MKL::MKL_SCALAPACK)
70+
list(APPEND BLACS_LIB MKL::MKL)
7171
else()
7272
set(BLACS_LIB ScaLAPACK::ScaLAPACK)
7373
endif()

source/source_esolver/esolver_dm2rho.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,22 @@ void ESolver_DM2rho<TK, TR>::runner(UnitCell& ucell, const int istep)
4646

4747
ESolver_KS_LCAO<TK, TR>::before_scf(ucell, istep);
4848

49-
auto* estate = dynamic_cast<elecstate::ElecStateLCAO<TK>*>(this->pelec);
50-
51-
if(!estate)
52-
{
53-
ModuleBase::WARNING_QUIT("ESolver_DM2rho::after_scf","pelec does not exist");
54-
}
55-
5649
// file name of DM
5750
std::string zipname = "output_DM0.npz";
58-
elecstate::DensityMatrix<TK, double>* dm = estate->get_DM();
5951

6052
// read DM from file
61-
ModuleIO::read_mat_npz(&(this->pv), ucell, zipname, *(dm->get_DMR_pointer(1)));
53+
ModuleIO::read_mat_npz(&(this->pv), ucell, zipname, *(this->dmat.dm->get_DMR_pointer(1)));
6254

6355
// if nspin=2, need extra reading
6456
if (PARAM.inp.nspin == 2)
6557
{
6658
zipname = "output_DM1.npz";
67-
ModuleIO::read_mat_npz(&(this->pv), ucell, zipname, *(dm->get_DMR_pointer(2)));
59+
ModuleIO::read_mat_npz(&(this->pv), ucell, zipname, *(this->dmat.dm->get_DMR_pointer(2)));
6860
}
6961

7062
// it's dangerous to design psiToRho function like this, mohan note 20251024
7163
// this->pelec->psiToRho(*this->psi);
72-
LCAO_domain::dm2rho(estate->DM->get_DMR_vector(), PARAM.inp.nspin, &this->chr);
64+
LCAO_domain::dm2rho(this->dmat.dm->get_DMR_vector(), PARAM.inp.nspin, &this->chr);
7365

7466
int nspin0 = PARAM.inp.nspin == 2 ? 2 : 1;
7567

source/source_esolver/esolver_double_xc.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void ESolver_DoubleXC<TK, TR>::before_all_runners(UnitCell& ucell, const Input_p
8484
}
8585

8686
// 6) initialize the density matrix
87-
dynamic_cast<elecstate::ElecStateLCAO<TK>*>(this->pelec_base)->init_DM(&this->kv, &(this->pv), PARAM.inp.nspin);
87+
this->dmat_base.allocate_dm(&this->kv, &this->pv, PARAM.inp.nspin);
8888

8989
// 10) inititlize the charge density
9090
this->chr_base.allocate(PARAM.inp.nspin);
@@ -138,8 +138,6 @@ void ESolver_DoubleXC<TK, TR>::before_scf(UnitCell& ucell, const int istep)
138138
}
139139
if (this->p_hamilt_base == nullptr)
140140
{
141-
elecstate::DensityMatrix<TK, double>* DM = dynamic_cast<elecstate::ElecStateLCAO<TK>*>(this->pelec_base)->get_DM();
142-
143141
this->p_hamilt_base = new hamilt::HamiltLCAO<TK, TR>(
144142
ucell,
145143
this->gd,
@@ -148,7 +146,7 @@ void ESolver_DoubleXC<TK, TR>::before_scf(UnitCell& ucell, const int istep)
148146
this->kv,
149147
this->two_center_bundle_,
150148
this->orb_,
151-
DM,
149+
this->dmat_base.dm,
152150
this->deepks,
153151
istep,
154152
this->exx_nao);
@@ -159,13 +157,11 @@ void ESolver_DoubleXC<TK, TR>::before_scf(UnitCell& ucell, const int istep)
159157
XC_Functional::set_xc_type(ucell.atoms[0].ncpp.xc_func);
160158

161159
// DMR should be same size with Hamiltonian(R)
162-
dynamic_cast<elecstate::ElecStateLCAO<TK>*>(this->pelec_base)
163-
->get_DM()
164-
->init_DMR(*(dynamic_cast<hamilt::HamiltLCAO<TK, TR>*>(this->p_hamilt_base)->getHR()));
160+
this->dmat_base.dm->init_DMR(*(dynamic_cast<hamilt::HamiltLCAO<TK, TR>*>(this->p_hamilt_base)->getHR()));
165161

166162
if (istep > 0)
167163
{
168-
dynamic_cast<elecstate::ElecStateLCAO<TK>*>(this->pelec_base)->get_DM()->cal_DMR();
164+
this->dmat_base.dm->cal_DMR();
169165
}
170166

171167
ModuleBase::timer::tick("ESolver_DoubleXC", "before_scf");
@@ -226,23 +222,23 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
226222
std::shared_ptr<LCAO_Deepks<TK>> ld_shared_ptr(&this->deepks.ld, [](LCAO_Deepks<TK>*) {});
227223
LCAO_Deepks_Interface<TK, TR> deepks_interface(ld_shared_ptr);
228224

229-
deepks_interface.out_deepks_labels(this->pelec->f_en.etot,
230-
this->kv.get_nks(),
231-
ucell.nat,
232-
PARAM.globalv.nlocal,
233-
this->pelec->ekb,
234-
this->kv.kvec_d,
235-
ucell,
236-
this->orb_,
237-
this->gd,
238-
&(this->pv),
239-
*(this->psi),
240-
dynamic_cast<const elecstate::ElecStateLCAO<TK>*>(this->pelec)->get_DM(),
241-
p_ham_deepks,
242-
iter,
243-
conv_esolver,
244-
GlobalV::MY_RANK,
245-
GlobalV::ofs_running);
225+
deepks_interface.out_deepks_labels(this->pelec->f_en.etot,
226+
this->kv.get_nks(),
227+
ucell.nat,
228+
PARAM.globalv.nlocal,
229+
this->pelec->ekb,
230+
this->kv.kvec_d,
231+
ucell,
232+
this->orb_,
233+
this->gd,
234+
&(this->pv),
235+
*(this->psi),
236+
this->dmat.dm,
237+
p_ham_deepks,
238+
iter,
239+
conv_esolver,
240+
GlobalV::MY_RANK,
241+
GlobalV::ofs_running);
246242
#endif
247243

248244
// restore to density after charge mixing
@@ -352,9 +348,12 @@ void ESolver_DoubleXC<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int
352348
auto _pes_lcao = dynamic_cast<elecstate::ElecStateLCAO<TK>*>(this->pelec);
353349
for (int ik = 0; ik < nks; ik++)
354350
{
355-
_pes_lcao_base->get_DM()->set_DMK_pointer(ik, _pes_lcao->get_DM()->get_DMK_pointer(ik));
351+
// mohan update 2025-11-03
352+
this->dmat_base.dm->set_DMK_pointer(ik, this->dmat.dm->get_DMK_pointer(ik));
353+
// _pes_lcao_base->get_DM()->set_DMK_pointer(ik, _pes_lcao->get_DM()->get_DMK_pointer(ik));
356354
}
357-
_pes_lcao_base->get_DM()->cal_DMR();
355+
this->dmat_base.dm->cal_DMR();
356+
// _pes_lcao_base->get_DM()->cal_DMR();
358357
_pes_lcao_base->ekb = _pes_lcao->ekb;
359358
_pes_lcao_base->wg = _pes_lcao->wg;
360359
}
@@ -386,6 +385,7 @@ void ESolver_DoubleXC<TK, TR>::cal_force(UnitCell& ucell, ModuleBase::matrix& fo
386385
this->gd,
387386
this->pv,
388387
this->pelec_base,
388+
this->dmat_base, // mohan add 2025-11-03
389389
this->psi,
390390
this->two_center_bundle_,
391391
this->orb_,

source/source_esolver/esolver_double_xc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class ESolver_DoubleXC : public ESolver_KS_LCAO<TK, TR>
3232
//! Electronic states
3333
elecstate::ElecState* pelec_base = nullptr;
3434

35+
//! Density Matrix, mohan add 2025-11-03
36+
LCAO_domain::Setup_DM<TK> dmat_base;
37+
3538
//! Electorn charge density
3639
Charge chr_base;
3740
};

source/source_esolver/esolver_fp.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ void ESolver_FP::before_all_runners(UnitCell& ucell, const Input_para& inp)
5454

5555
// write geometry file
5656
ModuleIO::CifParser::write(PARAM.globalv.global_out_dir + "STRU.cif",
57-
ucell,
58-
"# Generated by ABACUS ModuleIO::CifParser",
59-
"data_?");
57+
ucell, "# Generated by ABACUS ModuleIO::CifParser", "data_?");
6058

6159
// init charge extrapolation
6260
this->CE.Init_CE(inp.nspin, ucell.nat, this->pw_rhod->nrxx, inp.chg_extrap);

0 commit comments

Comments
 (0)