@@ -46,28 +46,6 @@ void LR::ESolver_LR<double>::move_exx_lri(std::shared_ptr<Exx_LRI<std::complex<d
4646template <>void LR::ESolver_LR<double >::set_gint() { this ->gint_ = &this ->gint_g_ ;this ->gint_g_ .gridt = &this ->gt_ ; }
4747template <>void LR::ESolver_LR<std::complex <double >>::set_gint() { this ->gint_ = &this ->gint_k_ ; this ->gint_k_ .gridt = &this ->gt_ ; }
4848
49- inline double getreal (std::complex <double > x) { return x.real (); }
50- inline double getreal (double x) { return x; }
51-
52- inline void redirect_log (const bool & out_alllog)
53- {
54- GlobalV::ofs_running.close ();
55- std::stringstream ss;
56- if (out_alllog)
57- {
58- ss << PARAM.globalv .global_out_dir << " running_lr_" << GlobalV::MY_RANK + 1 << " .log" ;
59- GlobalV::ofs_running.open (ss.str ());
60- }
61- else
62- {
63- if (GlobalV::MY_RANK == 0 )
64- {
65- ss << PARAM.globalv .global_out_dir << " running_lr.log" ;
66- GlobalV::ofs_running.open (ss.str ());
67- }
68- }
69- }
70-
7149inline int cal_nupdown_form_occ (const ModuleBase::matrix& wg)
7250{ // only for nspin=2
7351 const int & nk = wg.nr / 2 ;
@@ -155,7 +133,6 @@ LR::ESolver_LR<T, TR>::ESolver_LR(ModuleESolver::ESolver_KS_LCAO<T, TR>&& ks_sol
155133 , exx_info(GlobalC::exx_info)
156134#endif
157135{
158- redirect_log (inp.out_alllog );
159136 ModuleBase::TITLE (" ESolver_LR" , " ESolver_LR(KS)" );
160137
161138 if (this ->input .lr_solver == " spectrum" ) {
@@ -259,7 +236,6 @@ LR::ESolver_LR<T, TR>::ESolver_LR(const Input_para& inp, UnitCell& ucell) : inpu
259236, exx_info(GlobalC::exx_info)
260237#endif
261238{
262- redirect_log (inp.out_alllog );
263239 ModuleBase::TITLE (" ESolver_LR" , " ESolver_LR(from scratch)" );
264240 // xc kernel
265241 this ->xc_kernel = inp.xc_kernel ;
@@ -431,6 +407,7 @@ template <typename T, typename TR>
431407void LR::ESolver_LR<T, TR>::runner(int istep, UnitCell& cell)
432408{
433409 ModuleBase::TITLE (" ESolver_LR" , " runner" );
410+ ModuleBase::timer::tick (" ESolver_LR" , " runner" );
434411 // allocate 2-particle state and setup 2d division
435412 this ->setup_eigenvectors_X ();
436413 this ->pelec ->ekb .create (nspin, this ->nstates );
@@ -494,6 +471,7 @@ void LR::ESolver_LR<T, TR>::runner(int istep, UnitCell& cell)
494471 for (int is = 0 ;is < nspin;++is) { read_states (spin_types[is], this ->pelec ->ekb .c + is * nstates, this ->X [is].template data <T>(), nloc_per_band, nstates); }
495472 }
496473 }
474+ ModuleBase::timer::tick (" ESolver_LR" , " runner" );
497475 return ;
498476}
499477
0 commit comments