From 3eac0e2d7ce3a4262d4115a2b52f34a4d70f6e9b Mon Sep 17 00:00:00 2001 From: Qianrui Liu <76200646+Qianruipku@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:48:52 +0800 Subject: [PATCH 1/4] Fix: makefile cannot compile without openmp (#5316) --- source/module_hsolver/diago_elpa_native.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/module_hsolver/diago_elpa_native.cpp b/source/module_hsolver/diago_elpa_native.cpp index 2bd5953147..213ac67819 100644 --- a/source/module_hsolver/diago_elpa_native.cpp +++ b/source/module_hsolver/diago_elpa_native.cpp @@ -81,7 +81,11 @@ void DiagoElpaNative::diag_pool(hamilt::MatrixBlock& h_mat, // elpa_init(20210430); int success; elpa_t handle = elpa_allocate(&success); +#ifdef _OPENMP int num_threads = omp_get_max_threads(); +#else + int num_threads = 1; +#endif elpa_set(handle, "omp_threads", num_threads, &success); elpa_set(handle, "na", (int)nFull, &success); elpa_set(handle, "nev", (int)nev, &success); From 6632c0b6d8eb334b949facb07af4adfb5f75dd14 Mon Sep 17 00:00:00 2001 From: dzzz2001 <153698752+dzzz2001@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:49:33 +0800 Subject: [PATCH 2/4] fix nspin=4 error (#5319) --- source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu b/source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu index a406fd24fe..145f37417d 100644 --- a/source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu +++ b/source/module_hamilt_lcao/module_gint/gint_vl_gpu.cu @@ -47,7 +47,8 @@ void gint_vl_gpu(hamilt::HContainer* hRGint, checkCuda(cudaStreamCreate(&streams[i])); } - Cuda_Mem_Wrapper grid_vlocal_g(hRGint->get_nnr(), 1, false); + const int nnrg = is_gamma_only ? hRGint->get_nnr() : gridt.nnrg; + Cuda_Mem_Wrapper grid_vlocal_g(nnrg, 1, false); grid_vlocal_g.memset_device_sync(); Cuda_Mem_Wrapper dr_part(max_atom_per_z * 3, num_streams, true); @@ -189,7 +190,7 @@ void gint_vl_gpu(hamilt::HContainer* hRGint, checkCuda(cudaMemcpy( hRGint->get_wrapper(), grid_vlocal_g.get_device_pointer(), - hRGint->get_nnr() * sizeof(double), + nnrg * sizeof(double), cudaMemcpyDeviceToHost)); } else @@ -197,7 +198,7 @@ void gint_vl_gpu(hamilt::HContainer* hRGint, checkCuda(cudaMemcpy( pvpR, grid_vlocal_g.get_device_pointer(), - hRGint->get_nnr() * sizeof(double), + nnrg * sizeof(double), cudaMemcpyDeviceToHost)); } for (int i = 0; i < num_streams; i++) From 8a02642fb3cb23ed34791610043672255d65aab7 Mon Sep 17 00:00:00 2001 From: Peng Xingliang <91927439+pxlxingliang@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:50:05 +0800 Subject: [PATCH 3/4] doc: fix typo in kpt.md (#5320) Co-authored-by: root --- docs/advanced/input_files/kpt.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/advanced/input_files/kpt.md b/docs/advanced/input_files/kpt.md index 9c0eb336b1..853a3dc340 100644 --- a/docs/advanced/input_files/kpt.md +++ b/docs/advanced/input_files/kpt.md @@ -8,7 +8,7 @@ ABACUS uses periodic boundary conditions for both crystals and finite systems. F ## Gamma-only Calculations -In ABACUS, we offer th option of running gamma-only calculations for LCAO basis by setting [gamma_only](./input-main.md#gamma_only) to be 1. Due to details of implementation, gamma-only calculation will be slightly faster than running a non gamma-only calculation and explicitly setting gamma point to be the only the k-point, but the results should be consistent. +In ABACUS, we offer the option of running gamma-only calculations for LCAO basis by setting [gamma_only](./input-main.md#gamma_only) to be 1. Due to details of implementation, gamma-only calculation will be slightly faster than running a non gamma-only calculation and explicitly setting gamma point to be the only the k-point, but the results should be consistent. > If gamma_only is set to 1, the KPT file will be overwritten. So make sure to turn off gamma_only for multi-k calculations. @@ -23,7 +23,7 @@ method to generate k-mesh, and the following is an example input k-point (`KPT`) K_POINTS //keyword for start 0 //total number of k-point, `0' means generate automatically Gamma //which kind of Monkhorst-Pack method, `Gamma' or `MP' -2 2 2 0 0 0 //first three number: subdivisions along recpri. vectors +2 2 2 0 0 0 //first three number: subdivisions along reciprocal vectors //last three number: shift of the mesh ``` @@ -63,8 +63,8 @@ Direct //`Direct' or `Cartesian' coordinate ## Band structure calculations ABACUS uses specified high-symmetry directions of the Brillouin zone for band structure -calculations. The third line of k-point file should start with ‘Line’ or ‘Line_Cartesian’ for -line mode. ‘Line’ means the positions below are in Direct coordinates, while ‘Line_Cartesian’ +calculations. The third line of k-point file should start with 'Line' or 'Line_Cartesian' for +line mode. 'Line' means the positions below are in Direct coordinates, while 'Line_Cartesian' means in Cartesian coordinates: ``` From efb83c88766cf68092e79d064705de0bd5c98bf1 Mon Sep 17 00:00:00 2001 From: LUNASEA <33978601+maki49@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:56:57 +0800 Subject: [PATCH 4/4] remove read_rho and make read_cube independent of esolver_type (#5323) --- source/Makefile.Objects | 1 - .../module_charge/charge_init.cpp | 62 +++++++++---------- source/module_esolver/cal_edm_tddft.cpp | 1 - .../module_esolver/esolver_ks_lcao_tddft.cpp | 1 - source/module_esolver/esolver_ks_lcaopw.cpp | 1 - source/module_esolver/lcao_gets.cpp | 1 - source/module_esolver/lcao_nscf.cpp | 1 - source/module_esolver/lcao_others.cpp | 1 - source/module_esolver/pw_fun.cpp | 1 - source/module_esolver/pw_init_after_vc.cpp | 1 - source/module_esolver/pw_init_globalc.cpp | 1 - source/module_esolver/pw_nscf.cpp | 1 - source/module_esolver/pw_others.cpp | 1 - source/module_esolver/set_matrix_grid.cpp | 1 - source/module_io/CMakeLists.txt | 1 - source/module_io/cube_io.h | 2 - source/module_io/read_cube.cpp | 7 +-- source/module_io/read_rho.cpp | 42 ------------- source/module_io/rho_io.h | 31 ---------- source/module_io/test_serial/CMakeLists.txt | 2 +- source/module_io/test_serial/rho_io_test.cpp | 6 +- source/module_lr/esolver_lrtd_lcao.cpp | 6 +- 22 files changed, 36 insertions(+), 136 deletions(-) delete mode 100644 source/module_io/read_rho.cpp delete mode 100644 source/module_io/rho_io.h diff --git a/source/Makefile.Objects b/source/Makefile.Objects index 8bad2ec8bf..40fa2b85a6 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -484,7 +484,6 @@ OBJS_IO=input_conv.o\ output.o\ print_info.o\ read_cube.o\ - read_rho.o\ rhog_io.o\ read_exit_file.o\ read_wfc_pw.o\ diff --git a/source/module_elecstate/module_charge/charge_init.cpp b/source/module_elecstate/module_charge/charge_init.cpp index fea6955878..0c4737856b 100644 --- a/source/module_elecstate/module_charge/charge_init.cpp +++ b/source/module_elecstate/module_charge/charge_init.cpp @@ -14,7 +14,7 @@ #include "module_elecstate/magnetism.h" #include "module_hamilt_pw/hamilt_pwdft/global.h" #include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h" -#include "module_io/rho_io.h" +#include "module_io/cube_io.h" #include "module_io/rhog_io.h" #include "module_io/read_wfc_to_rho.h" #ifdef USE_PAW @@ -54,24 +54,22 @@ void Charge::init_rho(elecstate::efermi& eferm_iout, std::stringstream ssc; ssc << PARAM.globalv.global_readin_dir << "SPIN" << is + 1 << "_CHG.cube"; double& ef_tmp = eferm_iout.get_ef(is); - if (ModuleIO::read_rho( + if (ModuleIO::read_cube( #ifdef __MPI - &(GlobalC::Pgrid), + & (GlobalC::Pgrid), #endif - GlobalV::MY_RANK, - PARAM.inp.esolver_type, - GlobalV::RANK_IN_STOGROUP, - is, - GlobalV::ofs_running, - PARAM.inp.nspin, - ssc.str(), - this->rho[is], - this->rhopw->nx, - this->rhopw->ny, - this->rhopw->nz, - ef_tmp, - &(GlobalC::ucell), - this->prenspin)) + (PARAM.inp.esolver_type == "sdft" ? GlobalV::RANK_IN_STOGROUP : GlobalV::MY_RANK), + is, + GlobalV::ofs_running, + PARAM.inp.nspin, + ssc.str(), + this->rho[is], + this->rhopw->nx, + this->rhopw->ny, + this->rhopw->nz, + ef_tmp, + & (GlobalC::ucell), + this->prenspin)) { GlobalV::ofs_running << " Read in the charge density: " << ssc.str() << std::endl; } @@ -129,24 +127,22 @@ void Charge::init_rho(elecstate::efermi& eferm_iout, GlobalV::ofs_running << " try to read kinetic energy density from file : " << ssc.str() << std::endl; // mohan update 2012-02-10, sunliang update 2023-03-09 - if (ModuleIO::read_rho( + if (ModuleIO::read_cube( #ifdef __MPI - &(GlobalC::Pgrid), + & (GlobalC::Pgrid), #endif - GlobalV::MY_RANK, - PARAM.inp.esolver_type, - GlobalV::RANK_IN_STOGROUP, - is, - GlobalV::ofs_running, - PARAM.inp.nspin, - ssc.str(), - this->kin_r[is], - this->rhopw->nx, - this->rhopw->ny, - this->rhopw->nz, - eferm_iout.ef, - &(GlobalC::ucell), - this->prenspin)) + (PARAM.inp.esolver_type == "sdft" ? GlobalV::RANK_IN_STOGROUP : GlobalV::MY_RANK), + is, + GlobalV::ofs_running, + PARAM.inp.nspin, + ssc.str(), + this->kin_r[is], + this->rhopw->nx, + this->rhopw->ny, + this->rhopw->nz, + eferm_iout.ef, + & (GlobalC::ucell), + this->prenspin)) { GlobalV::ofs_running << " Read in the kinetic energy density: " << ssc.str() << std::endl; } diff --git a/source/module_esolver/cal_edm_tddft.cpp b/source/module_esolver/cal_edm_tddft.cpp index f5d31c9f5c..c34eb219b3 100644 --- a/source/module_esolver/cal_edm_tddft.cpp +++ b/source/module_esolver/cal_edm_tddft.cpp @@ -2,7 +2,6 @@ #include "module_io/cal_r_overlap_R.h" #include "module_io/dipole_io.h" -#include "module_io/rho_io.h" #include "module_io/td_current_io.h" #include "module_io/write_HS.h" #include "module_io/write_HS_R.h" diff --git a/source/module_esolver/esolver_ks_lcao_tddft.cpp b/source/module_esolver/esolver_ks_lcao_tddft.cpp index dd32335ebf..5c14fec3d0 100644 --- a/source/module_esolver/esolver_ks_lcao_tddft.cpp +++ b/source/module_esolver/esolver_ks_lcao_tddft.cpp @@ -2,7 +2,6 @@ #include "module_io/cal_r_overlap_R.h" #include "module_io/dipole_io.h" -#include "module_io/rho_io.h" #include "module_io/td_current_io.h" #include "module_io/write_HS.h" #include "module_io/write_HS_R.h" diff --git a/source/module_esolver/esolver_ks_lcaopw.cpp b/source/module_esolver/esolver_ks_lcaopw.cpp index 4bc9451941..ec95ea8761 100644 --- a/source/module_esolver/esolver_ks_lcaopw.cpp +++ b/source/module_esolver/esolver_ks_lcaopw.cpp @@ -32,7 +32,6 @@ #include "module_io/berryphase.h" #include "module_io/numerical_basis.h" #include "module_io/numerical_descriptor.h" -#include "module_io/rho_io.h" #include "module_io/to_wannier90_pw.h" #include "module_io/winput.h" #include "module_io/write_elecstat_pot.h" diff --git a/source/module_esolver/lcao_gets.cpp b/source/module_esolver/lcao_gets.cpp index cb1c1ab696..19af528966 100644 --- a/source/module_esolver/lcao_gets.cpp +++ b/source/module_esolver/lcao_gets.cpp @@ -22,7 +22,6 @@ #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" #include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" #include "module_io/read_wfc_nao.h" -#include "module_io/rho_io.h" #include "module_io/write_elecstat_pot.h" #include "module_io/write_wfc_nao.h" #ifdef __EXX diff --git a/source/module_esolver/lcao_nscf.cpp b/source/module_esolver/lcao_nscf.cpp index e8a91b5b90..27dd4b0c45 100644 --- a/source/module_esolver/lcao_nscf.cpp +++ b/source/module_esolver/lcao_nscf.cpp @@ -29,7 +29,6 @@ #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" #include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" #include "module_io/read_wfc_nao.h" -#include "module_io/rho_io.h" #include "module_io/write_elecstat_pot.h" #include "module_io/write_wfc_nao.h" #ifdef __EXX diff --git a/source/module_esolver/lcao_others.cpp b/source/module_esolver/lcao_others.cpp index 2d117aaeed..5b07c91f16 100644 --- a/source/module_esolver/lcao_others.cpp +++ b/source/module_esolver/lcao_others.cpp @@ -27,7 +27,6 @@ #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" #include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" #include "module_io/read_wfc_nao.h" -#include "module_io/rho_io.h" #include "module_io/write_elecstat_pot.h" #include "module_io/write_wfc_nao.h" #ifdef __EXX diff --git a/source/module_esolver/pw_fun.cpp b/source/module_esolver/pw_fun.cpp index 18a92b4d41..81ca1d00be 100644 --- a/source/module_esolver/pw_fun.cpp +++ b/source/module_esolver/pw_fun.cpp @@ -34,7 +34,6 @@ #include "module_io/berryphase.h" #include "module_io/numerical_basis.h" #include "module_io/numerical_descriptor.h" -#include "module_io/rho_io.h" #include "module_io/to_wannier90_pw.h" #include "module_io/winput.h" #include "module_io/write_elecstat_pot.h" diff --git a/source/module_esolver/pw_init_after_vc.cpp b/source/module_esolver/pw_init_after_vc.cpp index 27632fae36..7d67d6f55f 100644 --- a/source/module_esolver/pw_init_after_vc.cpp +++ b/source/module_esolver/pw_init_after_vc.cpp @@ -34,7 +34,6 @@ #include "module_io/berryphase.h" #include "module_io/numerical_basis.h" #include "module_io/numerical_descriptor.h" -#include "module_io/rho_io.h" #include "module_io/to_wannier90_pw.h" #include "module_io/winput.h" #include "module_io/write_elecstat_pot.h" diff --git a/source/module_esolver/pw_init_globalc.cpp b/source/module_esolver/pw_init_globalc.cpp index 52763d368f..ef1dbf31cc 100644 --- a/source/module_esolver/pw_init_globalc.cpp +++ b/source/module_esolver/pw_init_globalc.cpp @@ -34,7 +34,6 @@ #include "module_io/berryphase.h" #include "module_io/numerical_basis.h" #include "module_io/numerical_descriptor.h" -#include "module_io/rho_io.h" #include "module_io/to_wannier90_pw.h" #include "module_io/winput.h" #include "module_io/write_elecstat_pot.h" diff --git a/source/module_esolver/pw_nscf.cpp b/source/module_esolver/pw_nscf.cpp index 4919892090..006efbe8b9 100644 --- a/source/module_esolver/pw_nscf.cpp +++ b/source/module_esolver/pw_nscf.cpp @@ -34,7 +34,6 @@ #include "module_io/berryphase.h" #include "module_io/numerical_basis.h" #include "module_io/numerical_descriptor.h" -#include "module_io/rho_io.h" #include "module_io/to_wannier90_pw.h" #include "module_io/winput.h" #include "module_io/write_elecstat_pot.h" diff --git a/source/module_esolver/pw_others.cpp b/source/module_esolver/pw_others.cpp index 14423a8c7a..23439501c1 100644 --- a/source/module_esolver/pw_others.cpp +++ b/source/module_esolver/pw_others.cpp @@ -34,7 +34,6 @@ #include "module_io/berryphase.h" #include "module_io/numerical_basis.h" #include "module_io/numerical_descriptor.h" -#include "module_io/rho_io.h" #include "module_io/to_wannier90_pw.h" #include "module_io/winput.h" #include "module_io/write_elecstat_pot.h" diff --git a/source/module_esolver/set_matrix_grid.cpp b/source/module_esolver/set_matrix_grid.cpp index 508ecc452d..7766804e67 100644 --- a/source/module_esolver/set_matrix_grid.cpp +++ b/source/module_esolver/set_matrix_grid.cpp @@ -12,7 +12,6 @@ #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" #include "module_hamilt_pw/hamilt_pwdft/global.h" #include "module_io/read_wfc_nao.h" -#include "module_io/rho_io.h" #include "module_io/write_elecstat_pot.h" #include "module_io/write_wfc_nao.h" #include "module_parameter/parameter.h" diff --git a/source/module_io/CMakeLists.txt b/source/module_io/CMakeLists.txt index 4014fb0c95..44e94bb057 100644 --- a/source/module_io/CMakeLists.txt +++ b/source/module_io/CMakeLists.txt @@ -13,7 +13,6 @@ list(APPEND objects output.cpp print_info.cpp read_cube.cpp - read_rho.cpp rhog_io.cpp read_exit_file.cpp read_wfc_pw.cpp diff --git a/source/module_io/cube_io.h b/source/module_io/cube_io.h index a6a296b5dd..89bdb2e75a 100644 --- a/source/module_io/cube_io.h +++ b/source/module_io/cube_io.h @@ -13,8 +13,6 @@ bool read_cube( const Parallel_Grid*const Pgrid, #endif const int my_rank, - const std::string esolver_type, - const int rank_in_stogroup, const int is, std::ofstream& ofs_running, const int nspin, diff --git a/source/module_io/read_cube.cpp b/source/module_io/read_cube.cpp index 94f2bc1ed5..78ea02c445 100644 --- a/source/module_io/read_cube.cpp +++ b/source/module_io/read_cube.cpp @@ -6,8 +6,6 @@ bool ModuleIO::read_cube( const Parallel_Grid*const Pgrid, #endif const int my_rank, - const std::string esolver_type, - const int rank_in_stogroup, const int is, std::ofstream& ofs_running, const int nspin, @@ -112,12 +110,11 @@ bool ModuleIO::read_cube( } } - const bool flag_read_rank = (my_rank == 0 || (esolver_type == "sdft" && rank_in_stogroup == 0)); #ifdef __MPI if(nx == nx_read && ny == ny_read && nz == nz_read) - ModuleIO::read_cube_core_match(ifs, Pgrid, flag_read_rank, data, nx*ny, nz); + ModuleIO::read_cube_core_match(ifs, Pgrid, (my_rank == 0), data, nx * ny, nz); else - ModuleIO::read_cube_core_mismatch(ifs, Pgrid, flag_read_rank, data, nx, ny, nz, nx_read, ny_read, nz_read); + ModuleIO::read_cube_core_mismatch(ifs, Pgrid, (my_rank == 0), data, nx, ny, nz, nx_read, ny_read, nz_read); #else ofs_running << " Read SPIN = " << is + 1 << " charge now." << std::endl; if(nx == nx_read && ny == ny_read && nz == nz_read) diff --git a/source/module_io/read_rho.cpp b/source/module_io/read_rho.cpp deleted file mode 100644 index e6d01f7086..0000000000 --- a/source/module_io/read_rho.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "module_io/rho_io.h" -#include "module_io/cube_io.h" - - -bool ModuleIO::read_rho( -#ifdef __MPI - Parallel_Grid* Pgrid, -#endif - int my_rank, - std::string esolver_type, - int rank_in_stogroup, - const int& is, - std::ofstream& ofs_running, - const int &nspin, - const std::string &fn, - double* rho, - int& nx, - int& ny, - int& nz, - double& ef, - const UnitCell* ucell, - int &prenspin) -{ - return ModuleIO::read_cube( -#ifdef __MPI - Pgrid, -#endif - my_rank, - esolver_type, - rank_in_stogroup, - is, - ofs_running, - nspin, - fn, - rho, - nx, - ny, - nz, - ef, - ucell, - prenspin); -} diff --git a/source/module_io/rho_io.h b/source/module_io/rho_io.h deleted file mode 100644 index d23467ad96..0000000000 --- a/source/module_io/rho_io.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef RHO_IO_H -#define RHO_IO_H -#include -#include "module_cell/unitcell.h" -#ifdef __MPI -#include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h" -#endif - -namespace ModuleIO -{ -bool read_rho( -#ifdef __MPI - Parallel_Grid* Pgrid, -#endif - int my_rank, - std::string esolver_type, - int rank_in_stogroup, - const int& is, - std::ofstream& ofs_running, - const int& nspin, - const std::string& fn, - double* rho, - int& nx, - int& ny, - int& nz, - double& ef, - const UnitCell* ucell, - int& prenspin); -} - -#endif diff --git a/source/module_io/test_serial/CMakeLists.txt b/source/module_io/test_serial/CMakeLists.txt index 5119a6b1d1..ce3993fb8e 100644 --- a/source/module_io/test_serial/CMakeLists.txt +++ b/source/module_io/test_serial/CMakeLists.txt @@ -46,7 +46,7 @@ AddTest( AddTest( TARGET io_rho_io LIBS parameter ${math_libs} base device cell_info - SOURCES rho_io_test.cpp ../read_cube.cpp ../write_cube.cpp ../read_rho.cpp ../output.cpp + SOURCES rho_io_test.cpp ../read_cube.cpp ../write_cube.cpp ../output.cpp ) AddTest( diff --git a/source/module_io/test_serial/rho_io_test.cpp b/source/module_io/test_serial/rho_io_test.cpp index 20c456ea1e..a478b2d8b3 100644 --- a/source/module_io/test_serial/rho_io_test.cpp +++ b/source/module_io/test_serial/rho_io_test.cpp @@ -1,4 +1,4 @@ -#include "module_io/rho_io.h" +#include "module_io/cube_io.h" #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -59,8 +59,6 @@ class RhoIOTest : public ::testing::Test UnitCell* ucell; int my_rank = 0; - std::string esolver_type = "ksdft"; - int rank_in_stogroup = 0; std::ofstream ofs_running = std::ofstream("unittest.log"); void SetUp() @@ -93,7 +91,7 @@ TEST_F(RhoIOTest, Read) double ef; UcellTestPrepare utp = UcellTestLib["Si"]; ucell = utp.SetUcellInfo(); - ModuleIO::read_rho(my_rank, esolver_type, rank_in_stogroup, is, ofs_running, nspin, fn, rho[is], nx, ny, nz, ef, ucell, prenspin); + ModuleIO::read_cube(my_rank, is, ofs_running, nspin, fn, rho[is], nx, ny, nz, ef, ucell, prenspin); EXPECT_DOUBLE_EQ(ef, 0.461002); EXPECT_DOUBLE_EQ(rho[0][0], 1.27020863940e-03); EXPECT_DOUBLE_EQ(rho[0][46655], 1.33581335706e-02); diff --git a/source/module_lr/esolver_lrtd_lcao.cpp b/source/module_lr/esolver_lrtd_lcao.cpp index f21a86d2c1..228f7f983d 100644 --- a/source/module_lr/esolver_lrtd_lcao.cpp +++ b/source/module_lr/esolver_lrtd_lcao.cpp @@ -8,7 +8,7 @@ #include #include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h" #include "module_io/read_wfc_nao.h" -#include "module_io/rho_io.h" +#include "module_io/cube_io.h" #include "module_io/print_info.h" #include "module_cell/module_neighbor/sltk_atom_arrange.h" #include "module_lr/utils/lr_util_print.h" @@ -596,13 +596,11 @@ void LR::ESolver_LR::read_ks_chg(Charge& chg_gs) ssc << PARAM.globalv.global_readin_dir << "SPIN" << is + 1 << "_CHG.cube"; GlobalV::ofs_running << ssc.str() << std::endl; double ef; - if (ModuleIO::read_rho( + if (ModuleIO::read_cube( #ifdef __MPI & (GlobalC::Pgrid), #endif GlobalV::MY_RANK, - PARAM.inp.esolver_type, - GlobalV::RANK_IN_STOGROUP, is, GlobalV::ofs_running, this->nspin,