diff --git a/source/driver_run.cpp b/source/driver_run.cpp index 95066d0fa7c..ecf4f044055 100644 --- a/source/driver_run.cpp +++ b/source/driver_run.cpp @@ -26,7 +26,6 @@ void Driver::driver_run() { ModuleBase::TITLE("Driver", "driver_line"); - ModuleBase::timer::tick("Driver", "driver_line"); //! 1: setup cell and atom information // this warning should not be here, mohan 2024-05-22 @@ -93,6 +92,5 @@ void Driver::driver_run() //! 6: output the json file Json::create_Json(&ucell, PARAM); - ModuleBase::timer::tick("Driver", "driver_line"); return; } diff --git a/source/module_basis/module_pw/pw_gatherscatter.h b/source/module_basis/module_pw/pw_gatherscatter.h index 3ce5c6d5a34..bcad2caa0a5 100644 --- a/source/module_basis/module_pw/pw_gatherscatter.h +++ b/source/module_basis/module_pw/pw_gatherscatter.h @@ -14,7 +14,7 @@ namespace ModulePW template void PW_Basis::gatherp_scatters(std::complex* in, std::complex* out) const { - ModuleBase::timer::tick(this->classname, "gatherp_scatters"); + //ModuleBase::timer::tick(this->classname, "gatherp_scatters"); if(this->poolnproc == 1) //In this case nst=nstot, nz = nplane, { @@ -32,7 +32,7 @@ void PW_Basis::gatherp_scatters(std::complex* in, std::complex* out) const outp[iz] = inp[iz]; } } - ModuleBase::timer::tick(this->classname, "gatherp_scatters"); + //ModuleBase::timer::tick(this->classname, "gatherp_scatters"); return; } #ifdef __MPI @@ -55,10 +55,15 @@ void PW_Basis::gatherp_scatters(std::complex* in, std::complex* out) const //exchange data //(nplane,nstot) to (numz[ip],ns, poolnproc) - if(typeid(T) == typeid(double)) - MPI_Alltoallv(out, numr, startr, MPI_DOUBLE_COMPLEX, in, numg, startg, MPI_DOUBLE_COMPLEX, this->pool_world); - else if(typeid(T) == typeid(float)) - MPI_Alltoallv(out, numr, startr, MPI_COMPLEX, in, numg, startg, MPI_COMPLEX, this->pool_world); + if(typeid(T) == typeid(double)) + { + MPI_Alltoallv(out, numr, startr, MPI_DOUBLE_COMPLEX, in, numg, startg, MPI_DOUBLE_COMPLEX, this->pool_world); + } + else if(typeid(T) == typeid(float)) + { + MPI_Alltoallv(out, numr, startr, MPI_COMPLEX, in, numg, startg, MPI_COMPLEX, this->pool_world); + } + // change (nz,ns) to (numz[ip],ns, poolnproc) #ifdef _OPENMP #pragma omp parallel for collapse(2) @@ -80,7 +85,7 @@ void PW_Basis::gatherp_scatters(std::complex* in, std::complex* out) const } #endif - ModuleBase::timer::tick(this->classname, "gatherp_scatters"); + //ModuleBase::timer::tick(this->classname, "gatherp_scatters"); return; } @@ -94,7 +99,7 @@ void PW_Basis::gatherp_scatters(std::complex* in, std::complex* out) const template void PW_Basis::gathers_scatterp(std::complex* in, std::complex* out) const { - ModuleBase::timer::tick(this->classname, "gathers_scatterp"); + //ModuleBase::timer::tick(this->classname, "gathers_scatterp"); if(this->poolnproc == 1) //In this case nrxx=fftnx*fftny*nz, nst = nstot, { @@ -147,10 +152,15 @@ void PW_Basis::gathers_scatterp(std::complex* in, std::complex* out) const //exchange data //(numz[ip],ns, poolnproc) to (nplane,nstot) - if(typeid(T) == typeid(double)) - MPI_Alltoallv(out, numg, startg, MPI_DOUBLE_COMPLEX, in, numr, startr, MPI_DOUBLE_COMPLEX, this->pool_world); - else if(typeid(T) == typeid(float)) - MPI_Alltoallv(out, numg, startg, MPI_COMPLEX, in, numr, startr, MPI_COMPLEX, this->pool_world); + if(typeid(T) == typeid(double)) + { + MPI_Alltoallv(out, numg, startg, MPI_DOUBLE_COMPLEX, in, numr, startr, MPI_DOUBLE_COMPLEX, this->pool_world); + } + else if(typeid(T) == typeid(float)) + { + MPI_Alltoallv(out, numg, startg, MPI_COMPLEX, in, numr, startr, MPI_COMPLEX, this->pool_world); + } + #ifdef _OPENMP #pragma omp parallel for schedule(static, 4096/sizeof(T)) #endif @@ -175,10 +185,10 @@ void PW_Basis::gathers_scatterp(std::complex* in, std::complex* out) const } #endif - ModuleBase::timer::tick(this->classname, "gathers_scatterp"); + //ModuleBase::timer::tick(this->classname, "gathers_scatterp"); return; } -} \ No newline at end of file +} diff --git a/source/module_cell/klist.cpp b/source/module_cell/klist.cpp index 3c771d3dc6d..405511e5f79 100644 --- a/source/module_cell/klist.cpp +++ b/source/module_cell/klist.cpp @@ -52,7 +52,7 @@ void K_Vectors::set(const UnitCell& ucell, { ModuleBase::TITLE("K_Vectors", "set"); - ofs << "\n\n\n\n"; + ofs << "\n\n"; ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; ofs << " | |" << std::endl; ofs << " | Setup K-points |" << std::endl; @@ -61,7 +61,7 @@ void K_Vectors::set(const UnitCell& ucell, ofs << " | We treat the spin as another set of k-points. |" << std::endl; ofs << " | |" << std::endl; ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; - ofs << "\n\n\n\n"; + ofs << "\n\n"; ofs << "\n SETUP K-POINTS" << std::endl; diff --git a/source/module_cell/print_cell.cpp b/source/module_cell/print_cell.cpp index 7864f051041..d05136753cc 100644 --- a/source/module_cell/print_cell.cpp +++ b/source/module_cell/print_cell.cpp @@ -23,8 +23,7 @@ namespace unitcell bool direct = (Coordinate == "Direct"); std::string table; table += direct? "DIRECT COORDINATES\n": FmtCore::format("CARTESIAN COORDINATES ( UNIT = %20.12f Bohr ).\n", lat0); - const std::string redundant_header = direct? "taud_": "tauc_"; - table += FmtCore::format("%8s%20s%20s%20s%8s%20s%20s%20s\n", "atom", "x", "y", "z", "mag", "vx", "vy", "vz"); + table += FmtCore::format("%8s%10s%10s%10s%8s%8s%8s%8s\n", "atom", "x", "y", "z", "mag", "vx", "vy", "vz"); for(int it = 0; it < ntype; it++) { for (int ia = 0; ia < atoms[it].na; ia++) @@ -32,10 +31,8 @@ namespace unitcell const double& x = direct? atoms[it].taud[ia].x: atoms[it].tau[ia].x; const double& y = direct? atoms[it].taud[ia].y: atoms[it].tau[ia].y; const double& z = direct? atoms[it].taud[ia].z: atoms[it].tau[ia].z; - table += FmtCore::format("%5s%-s%-5d%20.10f%20.10f%20.10f%8.4f%20.10f%20.10f%20.10f\n", // I dont know why there must be a redundant "tau[c|d]_" in the output. So ugly, it should be removed! - redundant_header, + table += FmtCore::format("%8s%10.3f%10.3f%10.3f%8.3f%8.3f%8.3f%8.3f\n", atoms[it].label, - ia+1, x, y, z, @@ -140,4 +137,4 @@ namespace unitcell ofs.close(); return; } -} \ No newline at end of file +} diff --git a/source/module_cell/test/unitcell_test.cpp b/source/module_cell/test/unitcell_test.cpp index 08f764a22c7..7d037422bd5 100644 --- a/source/module_cell/test/unitcell_test.cpp +++ b/source/module_cell/test/unitcell_test.cpp @@ -1018,7 +1018,8 @@ TEST_F(UcellTest, PrintTauDirect) ifs.open("print_tau_direct"); std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); EXPECT_THAT(str, testing::HasSubstr("DIRECT COORDINATES")); - EXPECT_THAT(str, testing::HasSubstr("taud_C1 0.1000000000 0.1000000000 0.1000000000")); + EXPECT_THAT(str, testing::HasSubstr(" C 0.100 0.100 0.100 0.000 0.100 0.100 0.100")); + EXPECT_THAT(str, testing::HasSubstr(" H 0.150 0.150 0.150 0.000 0.100 0.100 0.100")); ifs.close(); remove("print_tau_direct"); } @@ -1036,7 +1037,8 @@ TEST_F(UcellTest, PrintTauCartesian) ifs.open("print_tau_Cartesian"); std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); EXPECT_THAT(str, testing::HasSubstr("CARTESIAN COORDINATES")); - EXPECT_THAT(str, testing::HasSubstr("tauc_C1 1.0000000000 1.0000000000 1.0000000000")); + EXPECT_THAT(str, testing::HasSubstr(" C 1.000 1.000 1.000 0.000 0.000 0.000 0.000")); + EXPECT_THAT(str, testing::HasSubstr(" H 1.500 1.500 1.500 0.000 0.000 0.000 0.000")); ifs.close(); remove("print_tau_Cartesian"); } diff --git a/source/module_cell/unitcell.cpp b/source/module_cell/unitcell.cpp index b5c8c6b8468..5f4dd37c866 100755 --- a/source/module_cell/unitcell.cpp +++ b/source/module_cell/unitcell.cpp @@ -214,7 +214,7 @@ void UnitCell::setup_cell(const std::string& fn, std::ofstream& log) { if (ok) { - log << "\n\n\n\n"; + log << "\n\n"; log << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" ">>>>>>>>>>>>" << std::endl; @@ -254,7 +254,7 @@ void UnitCell::setup_cell(const std::string& fn, std::ofstream& log) { log << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" "<<<<<<<<<<<<" << std::endl; - log << "\n\n\n\n"; + log << "\n\n"; log << " READING UNITCELL INFORMATION" << std::endl; //======================== @@ -560,4 +560,4 @@ void UnitCell::compare_atom_labels(std::string label1, std::string label2) { } } } -} \ No newline at end of file +} diff --git a/source/module_elecstate/module_charge/charge_mixing.cpp b/source/module_elecstate/module_charge/charge_mixing.cpp index 0fcc13fc5e7..6f17b84d476 100644 --- a/source/module_elecstate/module_charge/charge_mixing.cpp +++ b/source/module_elecstate/module_charge/charge_mixing.cpp @@ -58,22 +58,24 @@ void Charge_Mixing::set_mixing(const std::string& mixing_mode_in, } // print into running.log - GlobalV::ofs_running<<"\n----------- Double Check Mixing Parameters Begin ------------"<mixing_mode <mixing_beta <mixing_gg0 <mixing_mode); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_beta", this->mixing_beta); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_gg0", this->mixing_gg0); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_gg0_min", PARAM.inp.mixing_gg0_min); + if (PARAM.inp.nspin==2 || PARAM.inp.nspin==4) { - GlobalV::ofs_running<<"mixing_beta_mag: "<< this->mixing_beta_mag <mixing_beta_mag); + ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_gg0_mag", PARAM.inp.mixing_gg0_mag); } if (PARAM.inp.mixing_angle > 0) { - GlobalV::ofs_running<<"mixing_angle: "<< PARAM.inp.mixing_angle <mixing_ndim <mixing_ndim); return; } @@ -240,4 +242,4 @@ bool Charge_Mixing::if_scf_oscillate(const int iteration, const double drho, con } return false; -} \ No newline at end of file +} diff --git a/source/module_elecstate/potentials/pot_xc.cpp b/source/module_elecstate/potentials/pot_xc.cpp index f6b4607f2d2..907363fb17a 100644 --- a/source/module_elecstate/potentials/pot_xc.cpp +++ b/source/module_elecstate/potentials/pot_xc.cpp @@ -12,8 +12,8 @@ namespace elecstate void PotXC::cal_v_eff(const Charge*const chg, const UnitCell*const ucell, ModuleBase::matrix& v_eff) { - ModuleBase::TITLE("PotXC", "cal_v_eff"); - ModuleBase::timer::tick("PotXC", "cal_v_eff"); + ModuleBase::TITLE("PotXC", "cal_veff"); + ModuleBase::timer::tick("PotXC", "cal_veff"); const int nrxx_current = chg->nrxx; //---------------------------------------------------------- @@ -41,7 +41,7 @@ void PotXC::cal_v_eff(const Charge*const chg, const UnitCell*const ucell, Module *(this->vtxc_) = std::get<1>(etxc_vtxc_v); v_eff += std::get<2>(etxc_vtxc_v); } - ModuleBase::timer::tick("PotXC", "cal_v_eff"); + ModuleBase::timer::tick("PotXC", "cal_veff"); } -} // namespace elecstate \ No newline at end of file +} // namespace elecstate diff --git a/source/module_elecstate/potentials/potential_new.cpp b/source/module_elecstate/potentials/potential_new.cpp index 617e18a1788..4fb30c4b557 100644 --- a/source/module_elecstate/potentials/potential_new.cpp +++ b/source/module_elecstate/potentials/potential_new.cpp @@ -163,7 +163,8 @@ void Potential::allocate() void Potential::update_from_charge(const Charge*const chg, const UnitCell*const ucell) { ModuleBase::TITLE("Potential", "update_from_charge"); - ModuleBase::timer::tick("Potential", "update_from_charge"); + //ModuleBase::timer::tick("Potential", "update_from_charge"); + if (!this->fixed_done) { this->cal_fixed_v(this->v_effective_fixed.data()); @@ -216,13 +217,14 @@ void Potential::update_from_charge(const Charge*const chg, const UnitCell*const } #endif - ModuleBase::timer::tick("Potential", "update_from_charge"); + //ModuleBase::timer::tick("Potential", "update_from_charge"); } void Potential::cal_fixed_v(double* vl_pseudo) { ModuleBase::TITLE("Potential", "cal_fixed_v"); ModuleBase::timer::tick("Potential", "cal_fixed_v"); + this->v_effective_fixed.assign(this->v_effective_fixed.size(), 0.0); for (size_t i = 0; i < this->components.size(); i++) { @@ -237,10 +239,11 @@ void Potential::cal_fixed_v(double* vl_pseudo) void Potential::cal_v_eff(const Charge*const chg, const UnitCell*const ucell, ModuleBase::matrix& v_eff) { - ModuleBase::TITLE("Potential", "cal_v_eff"); + ModuleBase::TITLE("Potential", "cal_veff"); + ModuleBase::timer::tick("Potential", "cal_veff"); + const int nspin_current = this->v_effective.nr; const int nrxx = this->v_effective.nc; - ModuleBase::timer::tick("Potential", "cal_v_eff"); // first of all, set v_effective to zero. this->v_effective.zero_out(); @@ -264,7 +267,7 @@ void Potential::cal_v_eff(const Charge*const chg, const UnitCell*const ucell, Mo } } - ModuleBase::timer::tick("Potential", "cal_v_eff"); + ModuleBase::timer::tick("Potential", "cal_veff"); } void Potential::init_pot(int istep, const Charge*const chg) @@ -278,8 +281,6 @@ void Potential::init_pot(int istep, const Charge*const chg) this->update_from_charge(chg, this->ucell_); - // plots - // figure::picture(this->vr_eff1,GlobalC::rhopw->nx,GlobalC::rhopw->ny,GlobalC::rhopw->nz); ModuleBase::timer::tick("Potential", "init_pot"); return; } diff --git a/source/module_elecstate/read_pseudo.cpp b/source/module_elecstate/read_pseudo.cpp index f91073e6c99..7921e43bbe6 100644 --- a/source/module_elecstate/read_pseudo.cpp +++ b/source/module_elecstate/read_pseudo.cpp @@ -11,7 +11,7 @@ namespace elecstate { void read_pseudo(std::ofstream& ofs, UnitCell& ucell) { // read in non-local pseudopotential and ouput the projectors. - ofs << "\n\n\n\n"; + ofs << "\n\n"; ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" ">>>>" << std::endl; @@ -54,7 +54,7 @@ void read_pseudo(std::ofstream& ofs, UnitCell& ucell) { ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" "<<<<" << std::endl; - ofs << "\n\n\n\n"; + ofs << "\n\n"; read_cell_pseudopots(PARAM.inp.pseudo_dir, ofs, ucell); @@ -368,4 +368,4 @@ void print_unitcell_pseudo(const std::string& fn, UnitCell& ucell) return; } -} \ No newline at end of file +} diff --git a/source/module_esolver/esolver.cpp b/source/module_esolver/esolver.cpp index a727a7a095e..46f4e238401 100644 --- a/source/module_esolver/esolver.cpp +++ b/source/module_esolver/esolver.cpp @@ -95,7 +95,7 @@ std::string determine_type() ModuleBase::WARNING_QUIT("ESolver", "No such esolver_type combined with basis_type"); } - GlobalV::ofs_running << " The esolver type has been set to : " << esolver_type << std::endl; + GlobalV::ofs_running << "\n The esolver type: " << esolver_type << std::endl; auto device_info = PARAM.inp.device; diff --git a/source/module_esolver/esolver_fp.h b/source/module_esolver/esolver_fp.h index 1e7f23c02c7..a4507c7c553 100644 --- a/source/module_esolver/esolver_fp.h +++ b/source/module_esolver/esolver_fp.h @@ -56,7 +56,7 @@ class ESolver_FP: public ESolver //! Something to do after SCF iterations when SCF is converged or comes to the max iter step. virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver); - //! Something to do after hamilt2density function in each iter loop. + //! Something to do after hamilt2rho function in each iter loop. virtual void iter_finish(UnitCell& ucell, const int istep, int& iter, bool &conv_esolver); //! ------------------------------------------------------------------------------ diff --git a/source/module_esolver/esolver_ks.cpp b/source/module_esolver/esolver_ks.cpp index b4e3bcd349e..932da275293 100644 --- a/source/module_esolver/esolver_ks.cpp +++ b/source/module_esolver/esolver_ks.cpp @@ -343,25 +343,25 @@ void ESolver_KS::before_all_runners(UnitCell& ucell, const Input_para } //------------------------------------------------------------------------------ -//! the 5th function of ESolver_KS: hamilt2density_single +//! the 5th function of ESolver_KS: hamilt2rho_single //! mohan add 2024-05-11 //------------------------------------------------------------------------------ template -void ESolver_KS::hamilt2density_single(UnitCell& ucell, const int istep, const int iter, const double ethr) +void ESolver_KS::hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) { - ModuleBase::timer::tick(this->classname, "hamilt2density_single"); + ModuleBase::timer::tick(this->classname, "hamilt2rho_single"); // Temporarily, before HSolver is constructed, it should be overrided by // LCAO, PW, SDFT and TDDFT. // After HSolver is constructed, LCAO, PW, SDFT should delete their own - // hamilt2density_single() and use: - ModuleBase::timer::tick(this->classname, "hamilt2density_single"); + // hamilt2rho_single() and use: + ModuleBase::timer::tick(this->classname, "hamilt2rho_single"); } template -void ESolver_KS::hamilt2density(UnitCell& ucell, const int istep, const int iter, const double ethr) +void ESolver_KS::hamilt2rho(UnitCell& ucell, const int istep, const int iter, const double ethr) { // 7) use Hamiltonian to obtain charge density - this->hamilt2density_single(ucell, istep, iter, diag_ethr); + this->hamilt2rho_single(ucell, istep, iter, diag_ethr); // 8) for MPI: STOGROUP? need to rewrite // It may be changed when more clever parallel algorithm is @@ -398,7 +398,7 @@ void ESolver_KS::hamilt2density(UnitCell& ucell, const int istep, con diag_ethr, PARAM.inp.nelec); - this->hamilt2density_single(ucell, istep, iter, diag_ethr); + this->hamilt2rho_single(ucell, istep, iter, diag_ethr); drho = p_chgmix->get_drho(&this->chr, PARAM.inp.nelec); @@ -458,7 +458,7 @@ void ESolver_KS::runner(UnitCell& ucell, const int istep) this->iter_init(ucell, istep, iter); // 6) use Hamiltonian to obtain charge density - this->hamilt2density(ucell, istep, iter, diag_ethr); + this->hamilt2rho(ucell, istep, iter, diag_ethr); // 7) finish scf iterations this->iter_finish(ucell, istep, iter, conv_esolver); diff --git a/source/module_esolver/esolver_ks.h b/source/module_esolver/esolver_ks.h index 75e6ff91bcd..b0ef3eb279f 100644 --- a/source/module_esolver/esolver_ks.h +++ b/source/module_esolver/esolver_ks.h @@ -48,17 +48,17 @@ class ESolver_KS : public ESolver_FP //! Something to do before SCF iterations. virtual void before_scf(UnitCell& ucell, const int istep) override; - //! Something to do before hamilt2density function in each iter loop. + //! Something to do before hamilt2rho function in each iter loop. virtual void iter_init(UnitCell& ucell, const int istep, const int iter); - //! Something to do after hamilt2density function in each iter loop. + //! Something to do after hamilt2rho function in each iter loop. virtual void iter_finish(UnitCell& ucell, const int istep, int& iter, bool& conv_esolver) override; // calculate electron density from a specific Hamiltonian with ethr - virtual void hamilt2density_single(UnitCell& ucell, const int istep, const int iter, const double ethr); + virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr); // calculate electron density from a specific Hamiltonian - void hamilt2density(UnitCell& ucell, const int istep, const int iter, const double ethr); + void hamilt2rho(UnitCell& ucell, const int istep, const int iter, const double ethr); //! Something to do after SCF iterations when SCF is converged or comes to the max iter step. virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) override; diff --git a/source/module_esolver/esolver_ks_lcao.cpp b/source/module_esolver/esolver_ks_lcao.cpp index 554be9a3c03..9549cc511e9 100644 --- a/source/module_esolver/esolver_ks_lcao.cpp +++ b/source/module_esolver/esolver_ks_lcao.cpp @@ -739,9 +739,9 @@ void ESolver_KS_LCAO::iter_init(UnitCell& ucell, const int istep, const template -void ESolver_KS_LCAO::hamilt2density_single(UnitCell& ucell, int istep, int iter, double ethr) +void ESolver_KS_LCAO::hamilt2rho_single(UnitCell& ucell, int istep, int iter, double ethr) { - ModuleBase::TITLE("ESolver_KS_LCAO", "hamilt2density_single"); + ModuleBase::TITLE("ESolver_KS_LCAO", "hamilt2rho_single"); // i1) reset energy this->pelec->f_en.eband = 0.0; @@ -781,11 +781,11 @@ void ESolver_KS_LCAO::hamilt2density_single(UnitCell& ucell, int istep, { if (GlobalC::exx_info.info_ri.real_number) { - this->exd->exx_hamilt2density(*this->pelec, this->pv, iter); + this->exd->exx_hamilt2rho(*this->pelec, this->pv, iter); } else { - this->exc->exx_hamilt2density(*this->pelec, this->pv, iter); + this->exc->exx_hamilt2rho(*this->pelec, this->pv, iter); } } #endif diff --git a/source/module_esolver/esolver_ks_lcao.h b/source/module_esolver/esolver_ks_lcao.h index 031400b2cc9..774a3bc16ba 100644 --- a/source/module_esolver/esolver_ks_lcao.h +++ b/source/module_esolver/esolver_ks_lcao.h @@ -67,7 +67,7 @@ class ESolver_KS_LCAO : public ESolver_KS virtual void iter_init(UnitCell& ucell, const int istep, const int iter) override; - virtual void hamilt2density_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; + virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; virtual void update_pot(UnitCell& ucell, const int istep, const int iter, const bool conv_esolver) override; diff --git a/source/module_esolver/esolver_ks_lcao_tddft.cpp b/source/module_esolver/esolver_ks_lcao_tddft.cpp index 5628f5463df..4c38df56442 100644 --- a/source/module_esolver/esolver_ks_lcao_tddft.cpp +++ b/source/module_esolver/esolver_ks_lcao_tddft.cpp @@ -87,7 +87,7 @@ void ESolver_KS_LCAO_TDDFT::before_all_runners(UnitCell& ucell, const In } template -void ESolver_KS_LCAO_TDDFT::hamilt2density_single(UnitCell& ucell, +void ESolver_KS_LCAO_TDDFT::hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) diff --git a/source/module_esolver/esolver_ks_lcao_tddft.h b/source/module_esolver/esolver_ks_lcao_tddft.h index 9232590fbf0..862b16a6ca1 100644 --- a/source/module_esolver/esolver_ks_lcao_tddft.h +++ b/source/module_esolver/esolver_ks_lcao_tddft.h @@ -58,7 +58,7 @@ class ESolver_KS_LCAO_TDDFT : public ESolver_KS_LCAO, doubl void before_all_runners(UnitCell& ucell, const Input_para& inp) override; protected: - virtual void hamilt2density_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; + virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; virtual void update_pot(UnitCell& ucell, const int istep, const int iter, const bool conv_esolver) override; diff --git a/source/module_esolver/esolver_ks_lcaopw.cpp b/source/module_esolver/esolver_ks_lcaopw.cpp index 8439265bfd1..045ac5d715d 100644 --- a/source/module_esolver/esolver_ks_lcaopw.cpp +++ b/source/module_esolver/esolver_ks_lcaopw.cpp @@ -132,10 +132,10 @@ namespace ModuleESolver } template - void ESolver_KS_LIP::hamilt2density_single(UnitCell& ucell, const int istep, const int iter, const double ethr) + void ESolver_KS_LIP::hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) { - ModuleBase::TITLE("ESolver_KS_LIP", "hamilt2density_single"); - ModuleBase::timer::tick("ESolver_KS_LIP", "hamilt2density_single"); + ModuleBase::TITLE("ESolver_KS_LIP", "hamilt2rho_single"); + ModuleBase::timer::tick("ESolver_KS_LIP", "hamilt2rho_single"); // reset energy this->pelec->f_en.eband = 0.0; @@ -171,7 +171,7 @@ namespace ModuleESolver // need 'rho(out)' and 'vr (v_h(in) and v_xc(in))' this->pelec->f_en.deband = this->pelec->cal_delta_eband(ucell); - ModuleBase::timer::tick("ESolver_KS_LIP", "hamilt2density_single"); + ModuleBase::timer::tick("ESolver_KS_LIP", "hamilt2rho_single"); } template diff --git a/source/module_esolver/esolver_ks_lcaopw.h b/source/module_esolver/esolver_ks_lcaopw.h index c73b74a38cc..74c12db1f80 100644 --- a/source/module_esolver/esolver_ks_lcaopw.h +++ b/source/module_esolver/esolver_ks_lcaopw.h @@ -30,7 +30,7 @@ namespace ModuleESolver virtual void iter_finish(UnitCell& ucell, const int istep, int& iter, bool& conv_esolver) override; /// All the other interfaces except this one are the same as ESolver_KS_PW. - virtual void hamilt2density_single(UnitCell& ucell, + virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; diff --git a/source/module_esolver/esolver_ks_pw.cpp b/source/module_esolver/esolver_ks_pw.cpp index 4626286801e..8f3822cf529 100644 --- a/source/module_esolver/esolver_ks_pw.cpp +++ b/source/module_esolver/esolver_ks_pw.cpp @@ -450,12 +450,12 @@ void ESolver_KS_PW::iter_init(UnitCell& ucell, const int istep, const // Temporary, it should be replaced by hsolver later. template -void ESolver_KS_PW::hamilt2density_single(UnitCell& ucell, +void ESolver_KS_PW::hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) { - ModuleBase::timer::tick("ESolver_KS_PW", "hamilt2density_single"); + ModuleBase::timer::tick("ESolver_KS_PW", "hamilt2rho_single"); // reset energy this->pelec->f_en.eband = 0.0; @@ -524,7 +524,7 @@ void ESolver_KS_PW::hamilt2density_single(UnitCell& ucell, srho.begin(is, this->chr, this->pw_rhod, ucell.symm); } - ModuleBase::timer::tick("ESolver_KS_PW", "hamilt2density_single"); + ModuleBase::timer::tick("ESolver_KS_PW", "hamilt2rho_single"); } // Temporary, it should be rewritten with Hamilt class. diff --git a/source/module_esolver/esolver_ks_pw.h b/source/module_esolver/esolver_ks_pw.h index d046bd28da1..c1650861771 100644 --- a/source/module_esolver/esolver_ks_pw.h +++ b/source/module_esolver/esolver_ks_pw.h @@ -48,7 +48,7 @@ class ESolver_KS_PW : public ESolver_KS virtual void others(UnitCell& ucell, const int istep) override; - virtual void hamilt2density_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; + virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; virtual void allocate_hamilt(const UnitCell& ucell); virtual void deallocate_hamilt(); diff --git a/source/module_esolver/esolver_sdft_pw.cpp b/source/module_esolver/esolver_sdft_pw.cpp index d1c9da420ed..85cb3a909f8 100644 --- a/source/module_esolver/esolver_sdft_pw.cpp +++ b/source/module_esolver/esolver_sdft_pw.cpp @@ -132,10 +132,10 @@ void ESolver_SDFT_PW::after_scf(UnitCell& ucell, const int istep, con } template -void ESolver_SDFT_PW::hamilt2density_single(UnitCell& ucell, int istep, int iter, double ethr) +void ESolver_SDFT_PW::hamilt2rho_single(UnitCell& ucell, int istep, int iter, double ethr) { - ModuleBase::TITLE("ESolver_SDFT_PW", "hamilt2density"); - ModuleBase::timer::tick("ESolver_SDFT_PW", "hamilt2density"); + ModuleBase::TITLE("ESolver_SDFT_PW", "hamilt2rho"); + ModuleBase::timer::tick("ESolver_SDFT_PW", "hamilt2rho"); // reset energy this->pelec->f_en.eband = 0.0; @@ -207,7 +207,7 @@ void ESolver_SDFT_PW::hamilt2density_single(UnitCell& ucell, int iste #ifdef __MPI MPI_Bcast(&(this->pelec->f_en.deband), 1, MPI_DOUBLE, 0, BP_WORLD); #endif - ModuleBase::timer::tick("ESolver_SDFT_PW", "hamilt2density"); + ModuleBase::timer::tick("ESolver_SDFT_PW", "hamilt2rho"); } template diff --git a/source/module_esolver/esolver_sdft_pw.h b/source/module_esolver/esolver_sdft_pw.h index 4cb0fe0ddd1..dc284e7b21b 100644 --- a/source/module_esolver/esolver_sdft_pw.h +++ b/source/module_esolver/esolver_sdft_pw.h @@ -35,7 +35,7 @@ class ESolver_SDFT_PW : public ESolver_KS_PW protected: virtual void before_scf(UnitCell& ucell, const int istep) override; - virtual void hamilt2density_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; + virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; virtual void others(UnitCell& ucell, const int istep) override; diff --git a/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp b/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp index 74823eccc1a..4386bb7ae36 100644 --- a/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp +++ b/source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp @@ -216,7 +216,7 @@ void Nonlocal>::act( const int ngk_ik, const bool is_first_node)const { - ModuleBase::timer::tick("Operator", "NonlocalPW"); + ModuleBase::timer::tick("Operator", "nonlocal_pw"); if(is_first_node) { setmem_complex_op()(tmhpsi, 0, nbasis*nbands/npol); @@ -232,9 +232,10 @@ void Nonlocal>::act( //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // qianrui optimize 2021-3-31 int nkb = this->ppcell->nkb; - if (this->nkb_m < nbands * nkb) { - resmem_complex_op()(this->becp, nbands * nkb, "Nonlocal::becp"); - } + if (this->nkb_m < nbands * nkb) + { + resmem_complex_op()(this->becp, nbands * nkb, "Nonlocal::becp"); + } // ModuleBase::ComplexMatrix becp(nbands, nkb, false); char transa = 'C'; char transb = 'N'; @@ -302,7 +303,7 @@ void Nonlocal>::act( delete[] vnlpsi; #endif } - ModuleBase::timer::tick("Operator", "NonlocalPW"); + ModuleBase::timer::tick("Operator", "nonlocal_pw"); } template @@ -338,4 +339,4 @@ template class Nonlocal, base_device::DEVICE_GPU // Nonlocal, base_device::DEVICE_GPU>>::Nonlocal(const // Nonlocal, base_device::DEVICE_GPU>> *nonlocal); #endif -} // namespace hamilt \ No newline at end of file +} // namespace hamilt diff --git a/source/module_hamilt_pw/hamilt_pwdft/operator_pw/veff_pw.cpp b/source/module_hamilt_pw/hamilt_pwdft/operator_pw/veff_pw.cpp index c931d61f2f8..5d7f1dcf133 100644 --- a/source/module_hamilt_pw/hamilt_pwdft/operator_pw/veff_pw.cpp +++ b/source/module_hamilt_pw/hamilt_pwdft/operator_pw/veff_pw.cpp @@ -12,9 +12,11 @@ Veff>::Veff(const int* isk_in, const int veff_col, const ModulePW::PW_Basis_K* wfcpw_in) { - if (isk_in == nullptr || wfcpw_in == nullptr) { + if (isk_in == nullptr || wfcpw_in == nullptr) + { ModuleBase::WARNING_QUIT("VeffPW", "Constuctor of Operator::VeffPW is failed, please check your code!"); } + this->classname = "Veff"; this->cal_type = calculation_type::pw_veff; this->isk = isk_in; @@ -45,7 +47,7 @@ void Veff>::act( const int ngk_ik, const bool is_first_node)const { - ModuleBase::timer::tick("Operator", "VeffPW"); + ModuleBase::timer::tick("Operator", "veff_pw"); if(is_first_node) { setmem_complex_op()(tmhpsi, 0, nbasis*nbands/npol); @@ -53,67 +55,41 @@ void Veff>::act( int max_npw = nbasis / npol; const int current_spin = this->isk[this->ik]; + #ifdef __DSP wfcpw->fft_bundle.resource_handler(1); #endif - // T *porter = new T[wfcpw->nmaxgr]; + for (int ib = 0; ib < nbands; ib += npol) { if (npol == 1) { - // wfcpw->recip2real(tmpsi_in, porter, this->ik); wfcpw->recip_to_real(tmpsi_in, this->porter, this->ik); - // NOTICE: when MPI threads are larger than number of Z grids + // NOTICE: when MPI threads are larger than the number of Z grids // veff would contain nothing, and nothing should be done in real space // but the 3DFFT can not be skipped, it will cause hanging if(this->veff_col != 0) { veff_op()(this->ctx, this->veff_col, this->porter, this->veff + current_spin * this->veff_col); - // const Real* current_veff = &(this->veff[0](current_spin, 0)); - // for (int ir = 0; ir < this->veff->nc; ++ir) - // { - // porter[ir] *= current_veff[ir]; - // } } - // wfcpw->real2recip(porter, tmhpsi, this->ik, true); wfcpw->real_to_recip(this->porter, tmhpsi, this->ik, true); - // wfcpw->convolution(this->ctx, - // this->ik, - // this->veff_col, - // tmpsi_in, - // this->veff+current_spin, - // tmhpsi, - // true); } else { - // T *porter1 = new T[wfcpw->nmaxgr]; - // fft to real space and doing things. + // FFT to real space and do things. wfcpw->recip_to_real(tmpsi_in, this->porter, this->ik); wfcpw->recip_to_real(tmpsi_in + max_npw, this->porter1, this->ik); if(this->veff_col != 0) { /// denghui added at 20221109 - const Real* current_veff[4]; - for(int is = 0; is < 4; is++) { - current_veff[is] = this->veff + is * this->veff_col ; // for CPU device - } + const Real* current_veff[4]; + for(int is = 0; is < 4; is++) + { + current_veff[is] = this->veff + is * this->veff_col ; // for CPU device + } veff_op()(this->ctx, this->veff_col, this->porter, this->porter1, current_veff); - // T sup, sdown; - // for (int ir = 0; ir < this->veff_col; ir++) { - // sup = this->porter[ir] * (current_veff[0][ir] + current_veff[3][ir]) - // + this->porter1[ir] - // * (current_veff[1][ir] - // - T(0.0, 1.0) * current_veff[2][ir]); - // sdown = this->porter1[ir] * (current_veff[0][ir] - current_veff[3][ir]) - // + this->porter[ir] - // * (current_veff[1][ir] - // + T(0.0, 1.0) * current_veff[2][ir]); - // this->porter[ir] = sup; - // this->porter1[ir] = sdown; - // } } - // (3) fft back to G space. + // FFT back to G space. wfcpw->real_to_recip(this->porter, tmhpsi, this->ik, true); wfcpw->real_to_recip(this->porter1, tmhpsi + max_npw, this->ik, true); } @@ -123,7 +99,7 @@ void Veff>::act( #ifdef __DSP wfcpw->fft_bundle.resource_handler(0); #endif - ModuleBase::timer::tick("Operator", "VeffPW"); + ModuleBase::timer::tick("Operator", "veff_pw"); } template @@ -154,4 +130,4 @@ template class Veff, base_device::DEVICE_GPU>>; // template Veff, base_device::DEVICE_GPU>>::Veff(const // Veff, base_device::DEVICE_GPU>> *veff); #endif -} // namespace hamilt \ No newline at end of file +} // namespace hamilt diff --git a/source/module_hsolver/diago_iter_assist.cpp b/source/module_hsolver/diago_iter_assist.cpp index e39b8bd44b2..afc865f2ef9 100644 --- a/source/module_hsolver/diago_iter_assist.cpp +++ b/source/module_hsolver/diago_iter_assist.cpp @@ -28,8 +28,8 @@ void DiagoIterAssist::diagH_subspace(const hamilt::Hamilt* // of evc, if set to 0, n_band = nstart, default 0 ) { - ModuleBase::TITLE("DiagoIterAssist", "diagH_subspace"); - ModuleBase::timer::tick("DiagoIterAssist", "diagH_subspace"); + ModuleBase::TITLE("DiagoAssist", "diag_subspace"); + ModuleBase::timer::tick("DiagoAssist", "diag_subspace"); // two case: // 1. pw base: nstart = n_band, psi(nbands * npwx) @@ -143,7 +143,7 @@ void DiagoIterAssist::diagH_subspace(const hamilt::Hamilt* delmem_complex_op()(scc); delmem_complex_op()(vcc); - ModuleBase::timer::tick("DiagoIterAssist", "diagH_subspace"); + ModuleBase::timer::tick("DiagoAssist", "diag_subspace"); } template @@ -608,4 +608,4 @@ template class DiagoIterAssist; template class DiagoIterAssist; #endif #endif -} // namespace hsolver \ No newline at end of file +} // namespace hsolver diff --git a/source/module_hsolver/hsolver_pw.cpp b/source/module_hsolver/hsolver_pw.cpp index 62bff8a9158..a8b9c02eecf 100644 --- a/source/module_hsolver/hsolver_pw.cpp +++ b/source/module_hsolver/hsolver_pw.cpp @@ -375,6 +375,7 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, Real* eigenvalue, const int& nk_nums) { + ModuleBase::timer::tick("HSolverPW", "solve_psik"); #ifdef __MPI const diag_comm_info comm_info = {POOL_WORLD, this->rank_in_pool, this->nproc_in_pool}; #else @@ -421,7 +422,6 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, // wrap the hpsi_func and spsi_func into a lambda function auto hpsi_func = [hm, cur_nbasis](const ct::Tensor& psi_in, ct::Tensor& hpsi_out) { - ModuleBase::timer::tick("DiagoCG_New", "hpsi_func"); // psi_in should be a 2D tensor: // psi_in.shape() = [nbands, nbasis] const auto ndim = psi_in.shape().ndim(); @@ -436,10 +436,8 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, using hpsi_info = typename hamilt::Operator::hpsi_info; hpsi_info info(&psi_wrapper, all_bands_range, hpsi_out.data()); hm->ops->hPsi(info); - ModuleBase::timer::tick("DiagoCG_New", "hpsi_func"); }; auto spsi_func = [this, hm](const ct::Tensor& psi_in, ct::Tensor& spsi_out) { - ModuleBase::timer::tick("DiagoCG_New", "spsi_func"); // psi_in should be a 2D tensor: // psi_in.shape() = [nbands, nbasis] const auto ndim = psi_in.shape().ndim(); @@ -462,17 +460,18 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, static_cast((ndim == 1 ? 1 : psi_in.shape().dim_size(0)) * (ndim == 1 ? psi_in.NumElements() : psi_in.shape().dim_size(1)))); } - - ModuleBase::timer::tick("DiagoCG_New", "spsi_func"); }; + auto psi_tensor = ct::TensorMap(psi.get_pointer(), ct::DataTypeToEnum::value, ct::DeviceTypeToEnum::value, ct::TensorShape({psi.get_nbands(), psi.get_nbasis()})); + auto eigen_tensor = ct::TensorMap(eigenvalue, ct::DataTypeToEnum::value, ct::DeviceTypeToEnum::value, ct::TensorShape({psi.get_nbands()})); + auto prec_tensor = ct::TensorMap(pre_condition.data(), ct::DataTypeToEnum::value, ct::DeviceTypeToEnum::value, @@ -491,7 +490,6 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, const int ndim = psi.get_current_ngk(); // hpsi_func (X, HX, ld, nvec) -> HX = H(X), X and HX blockvectors of size ld x nvec auto hpsi_func = [hm, cur_nbasis](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) { - ModuleBase::timer::tick("diago_bpcg", "hpsi_func"); // Convert "pointer data stucture" to a psi::Psi object auto psi_iter_wrapper = psi::Psi(psi_in, 1, nvec, ld_psi, cur_nbasis); @@ -501,8 +499,6 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, using hpsi_info = typename hamilt::Operator::hpsi_info; hpsi_info info(&psi_iter_wrapper, bands_range, hpsi_out); hm->ops->hPsi(info); - - ModuleBase::timer::tick("diago_bpcg", "hpsi_func"); }; DiagoBPCG bpcg(pre_condition.data()); bpcg.init_iter(PARAM.inp.nbands, nband_l, nbasis, ndim); @@ -512,7 +508,6 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, { // hpsi_func (X, HX, ld, nvec) -> HX = H(X), X and HX blockvectors of size ld x nvec auto hpsi_func = [hm, cur_nbasis](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) { - ModuleBase::timer::tick("DavSubspace", "hpsi_func"); // Convert "pointer data stucture" to a psi::Psi object auto psi_iter_wrapper = psi::Psi(psi_in, 1, nvec, ld_psi, cur_nbasis); @@ -522,8 +517,6 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, using hpsi_info = typename hamilt::Operator::hpsi_info; hpsi_info info(&psi_iter_wrapper, bands_range, hpsi_out); hm->ops->hPsi(info); - - ModuleBase::timer::tick("DavSubspace", "hpsi_func"); }; bool scf = this->calculation_type == "nscf" ? false : true; @@ -565,7 +558,6 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, /// wrap hpsi into lambda function, Matrix \times blockvector // hpsi_func (X, HX, ld, nvec) -> HX = H(X), X and HX blockvectors of size ld x nvec auto hpsi_func = [hm, cur_nbasis](T* psi_in, T* hpsi_out, const int ld_psi, const int nvec) { - ModuleBase::timer::tick("David", "hpsi_func"); // Convert pointer of psi_in to a psi::Psi object auto psi_iter_wrapper = psi::Psi(psi_in, 1, nvec, ld_psi, cur_nbasis); @@ -575,8 +567,6 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, using hpsi_info = typename hamilt::Operator::hpsi_info; hpsi_info info(&psi_iter_wrapper, bands_range, hpsi_out); hm->ops->hPsi(info); - - ModuleBase::timer::tick("David", "hpsi_func"); }; /// wrap spsi into lambda function, Matrix \times blockvector @@ -587,11 +577,9 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, const int ld_psi, // Leading dimension of psi and spsi. const int nvec // Number of vectors(bands) ) { - ModuleBase::timer::tick("David", "spsi_func"); // sPsi determines S=I or not by PARAM.globalv.use_uspp inside // sPsi(psi, spsi, nrow, npw, nbands) hm->sPsi(psi_in, spsi_out, ld_psi, ld_psi, nvec); - ModuleBase::timer::tick("David", "spsi_func"); }; DiagoDavid david(pre_condition.data(), nband, dim, PARAM.inp.pw_diag_ndim, this->use_paw, comm_info); @@ -606,6 +594,7 @@ void HSolverPW::hamiltSolvePsiK(hamilt::Hamilt* hm, ntry_max, notconv_max)); } + ModuleBase::timer::tick("HSolverPW", "solve_psik"); return; } diff --git a/source/module_ri/Exx_LRI_interface.h b/source/module_ri/Exx_LRI_interface.h index 9c18ebad84f..82ec91b1817 100644 --- a/source/module_ri/Exx_LRI_interface.h +++ b/source/module_ri/Exx_LRI_interface.h @@ -63,8 +63,8 @@ class Exx_LRI_Interface const K_Vectors& kv, const int& iter); - /// @brief in hamilt2density: calculate Hexx and Eexx - void exx_hamilt2density(elecstate::ElecState& elec, const Parallel_Orbitals& pv, const int iter); + /// @brief in hamilt2rho: calculate Hexx and Eexx + void exx_hamilt2rho(elecstate::ElecState& elec, const Parallel_Orbitals& pv, const int iter); /// @brief in iter_finish: write Hexx, do something according to whether SCF is converged void exx_iter_finish(const K_Vectors& kv, diff --git a/source/module_ri/Exx_LRI_interface.hpp b/source/module_ri/Exx_LRI_interface.hpp index 8eecf44cc99..7c52c8ad04b 100644 --- a/source/module_ri/Exx_LRI_interface.hpp +++ b/source/module_ri/Exx_LRI_interface.hpp @@ -157,7 +157,7 @@ void Exx_LRI_Interface::exx_eachiterinit(const int istep, } template -void Exx_LRI_Interface::exx_hamilt2density(elecstate::ElecState& elec, const Parallel_Orbitals& pv, const int iter) +void Exx_LRI_Interface::exx_hamilt2rho(elecstate::ElecState& elec, const Parallel_Orbitals& pv, const int iter) { // Peize Lin add 2020.04.04 if (XC_Functional::get_func_type() == 4 || XC_Functional::get_func_type() == 5)