Skip to content

Commit 5282500

Browse files
mohanchenabacus_fixer
andauthored
Remove GlobalC::exx_info in module_ri (#7631)
* replace C++17 code with C++11 code * Phase 2: Change reference to value copy and add member variables for exx_info removal Change Exx_LRI and RPA_LRI's info_ri from const reference to value copy to eliminate lifetime dependencies on GlobalC::exx_info. Add abfs_Lmax_ member to Exx_LRI, hybrid_step_ member to Exx_LRI_interface, and p_info_ri pointer to LRI_CV for subsequent phases. All changes are backward-compatible. * Phase 3: Switch abfs_Lmax write from global to member with dual-write Change abfs_Lmax writing in Exx_LRI::init() and init_spencer() to write to member variable abfs_Lmax_ first, then sync to GlobalC::exx_info (dual-write) for backward compatibility. * Phase 4: Set info_ri pointer for LRI_CV and fix exx_rotate_abfs read Call cv.set_info_ri(&this->info) after cv.set_orbitals() in both Exx_LRI::init() and init_spencer(). Change LRI_CV::Cs_inv_thr reads to dual-read (pointer first, global fallback). Fix exx_rotate_abfs to read rotate_abfs from member reference instead of GlobalC. * Phase 5: Replace info_ri reads from GlobalC to member access Change 5 shrink_abfs_pca_thr reads in RPA_LRI and 2 exx_symmetry_realspace reads in Exx_LRI_interface from GlobalC::exx_info.info_ri to this->info or this->exx_ptr->info. * Phase 6: Eliminate abfs_Lmax global dependency in ewald_Vq Add abfs_Lmax parameter to Ewald_Vq::init(), store as member, and use in init_ions(). Pass abfs_Lmax_ from Exx_LRI to Ewald_Vq. Update RPA_LRI to read from exx_cut_coulomb->abfs_Lmax(). Remove dual-write to GlobalC for abfs_Lmax. * Phase 7: Replace ccp_rmesh_times global tampering with local copy Replace 3 places in RPA_LRI that tamper with GlobalC::exx_info.info_ri.ccp_rmesh_times: use local Exx_Info_RI copy instead. This eliminates the dangerous 'save-modify-use-restore' pattern. * Phase 8: Cache info_global in Exx_LRI_Interface constructor Add Exx_Info_Global as constructor parameter and store as member. Replace all 18 GlobalC::exx_info.info_global reads with this->info_global. Change hybrid_step write from global to member variable. * Phase 9: Remove info_global writes and sync_from_global in RPA_LRI Remove 3 lines that write ccp_type/hybrid_alpha to GlobalC and call sync_from_global(). This->info already has correct coulomb_param from construction. Also replace shrink_LU_inv_thr read with this->info. * Phase 10: Final cleanup - remove GlobalC::exx_info references and includes Delete global static object exx_lri_rpa in RPA_LRI.h. Update exx_rotate_abfs.h comment. Clean up includes in LRI_CV.hpp, exx_lip.hpp, and Exx_LRI_interface.hpp. Remove GlobalC::exx_info fallback in LRI_CV. After this phase, GlobalC::exx_info is no longer used in module_ri. * update the code * Fix: HSE energy deviation caused by stale info_global cache in Exx_LRI_Interface * fix bug because hybrid_step_ 在构造函数中没有从 info_global.hybrid_step 初始 * fix bug: abfs_Lmax degrades to 0 in the RPA + symmetry path. it is not a expected behavior --------- Co-authored-by: abacus_fixer <mohanchen@pku.eud.cn>
1 parent cb86cc4 commit 5282500

16 files changed

Lines changed: 136 additions & 92 deletions

source/source_esolver/esolver_ks_lcao.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ ESolver_KS_LCAO<TK, TR>::ESolver_KS_LCAO()
3535
{
3636
this->classname = "ESolver_KS_LCAO";
3737
this->basisname = "LCAO";
38-
this->exx_nao.init(); // mohan add 20251008
3938
}
4039

4140
template <typename TK, typename TR>
4241
ESolver_KS_LCAO<TK, TR>::~ESolver_KS_LCAO()
4342
{
44-
//****************************************************
45-
// do not add any codes in this deconstructor funcion
46-
//****************************************************
43+
//****************************************************
44+
// do not add any codes in this deconstructor funcion
45+
//****************************************************
4746
Setup_Psi<TK>::deallocate_psi(this->psi);
4847
}
4948

@@ -53,6 +52,9 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(UnitCell& ucell, const Input_pa
5352
ModuleBase::TITLE("ESolver_KS_LCAO", "before_all_runners");
5453
ModuleBase::timer::start("ESolver_KS_LCAO", "before_all_runners");
5554

55+
// 0) init EXX - moved from constructor to ensure GlobalC::exx_info.info_global is already set
56+
this->exx_nao.init();
57+
5658
// 1) before_all_runners in ESolver_KS
5759
ESolver_KS::before_all_runners(ucell, inp);
5860

source/source_lcao/module_hcontainer/test/test_add_value.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ class AddValueTest : public ::testing::Test
4141
{
4242
auto* hc = new hamilt::HContainer<double>(&paraV);
4343
insert_all_pairs(hc);
44-
for (auto& [i, j, vals] : fill)
44+
for (auto& item : fill)
4545
{
46+
int i = std::get<0>(item);
47+
int j = std::get<1>(item);
48+
const std::vector<double>& vals = std::get<2>(item);
4649
double* ptr = hc->find_matrix(i, j, 0, 0, 0)->get_pointer();
4750
for (int k = 0; k < (int)vals.size(); k++)
4851
ptr[k] = vals[k];

source/source_lcao/module_ri/Exx_LRI.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,12 @@ class Exx_LRI
107107
ModuleBase::matrix force_exx;
108108
ModuleBase::matrix stress_exx;
109109

110+
int abfs_Lmax() const { return abfs_Lmax_; }
111+
const Exx_Info_RI& get_info_ri() const { return info; }
110112

111113
private:
112-
// WARNING: reference to Exx_Info_RI, which holds references into Exx_Info_Global.
113-
// Must not outlive GlobalC::exx_info. See exx_info.h for details.
114-
const Exx_Info_RI &info;
114+
Exx_Info_RI info;
115+
int abfs_Lmax_ = 0;
115116
MPI_Comm mpi_comm;
116117
const K_Vectors *p_kv = nullptr;
117118
std::shared_ptr<ORB_gaunt_table> MGT;

source/source_lcao/module_ri/Exx_LRI.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ void Exx_LRI<Tdata>::init(const MPI_Comm &mpi_comm_in,
6565
Exx_Abfs::Construct_Orbs::print_orbs_size(ucell, this->abfs, GlobalV::ofs_running);
6666

6767
for( size_t T=0; T!=this->abfs.size(); ++T )
68-
{ GlobalC::exx_info.info_ri.abfs_Lmax = std::max( GlobalC::exx_info.info_ri.abfs_Lmax, static_cast<int>(this->abfs[T].size())-1 ); }
68+
{
69+
this->abfs_Lmax_ = std::max(this->abfs_Lmax_, static_cast<int>(this->abfs[T].size())-1);
70+
}
6971

7072
this->exx_objs.clear();
7173
this->coulomb_settings = RI_Util::update_coulomb_settings(this->info.coulomb_param, ucell, this->p_kv);
@@ -77,11 +79,14 @@ void Exx_LRI<Tdata>::init(const MPI_Comm &mpi_comm_in,
7779
this->exx_objs[settings_list.first].cv.set_orbitals(ucell, orb,
7880
this->lcaos, this->abfs, this->exx_objs[settings_list.first].abfs_ccp,
7981
this->info.kmesh_times, this->MGT, settings_list.second.first );
82+
this->exx_objs[settings_list.first].cv.set_info_ri(&this->info);
8083
if (settings_list.first == Conv_Coulomb_Pot_K::Coulomb_Method::Ewald)
8184
{
85+
const int evq_abfs_Lmax = this->abfs_Lmax_;
8286
this->exx_objs[settings_list.first].evq.init(ucell, orb,
8387
this->mpi_comm, this->p_kv, this->lcaos, this->abfs,
84-
settings_list.second.second, this->MGT, this->info.ccp_rmesh_times, this->info.kmesh_times);
88+
settings_list.second.second, this->MGT, this->info.ccp_rmesh_times, this->info.kmesh_times,
89+
evq_abfs_Lmax);
8590
}
8691
}
8792

@@ -125,8 +130,7 @@ void Exx_LRI<Tdata>::init_spencer(
125130

126131
for (size_t T = 0; T != this->abfs.size(); ++T)
127132
{
128-
GlobalC::exx_info.info_ri.abfs_Lmax
129-
= std::max(GlobalC::exx_info.info_ri.abfs_Lmax, static_cast<int>(this->abfs[T].size()) - 1);
133+
this->abfs_Lmax_ = std::max(this->abfs_Lmax_, static_cast<int>(this->abfs[T].size()) - 1);
130134
}
131135

132136
this->exx_objs.clear();
@@ -152,6 +156,7 @@ void Exx_LRI<Tdata>::init_spencer(
152156
this->info.kmesh_times,
153157
this->MGT,
154158
center2_settings->second.first);
159+
this->exx_objs[Conv_Coulomb_Pot_K::Coulomb_Method::Center2].cv.set_info_ri(&this->info);
155160

156161
ModuleBase::timer::end("Exx_LRI", "init_spencer");
157162
}

source/source_lcao/module_ri/Exx_LRI_interface.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "source_lcao/module_ri/module_exx_symmetry/symmetry_rotation.h"
88
#include "source_estate/module_dm/density_matrix.h" // mohan add 2025-11-04
99
#include "source_hamilt/hamilt.h"
10+
#include "source_hamilt/module_xc/exx_info_global.h"
1011
#include <memory>
1112

1213
class LCAO_Matrix;
@@ -39,9 +40,11 @@ class Exx_LRI_Interface
3940
using TAC = std::pair<TA, TC>;
4041

4142
/// @brief Constructor for Exx_LRI_Interface
42-
Exx_LRI_Interface(const Exx_Info_RI& info)
43+
Exx_LRI_Interface(const Exx_Info_RI& info_ri, const Exx_Info_Global& info_global)
4344
{
44-
this->exx_ptr = std::make_shared<Exx_LRI<Tdata>>(info);
45+
this->exx_ptr = std::make_shared<Exx_LRI<Tdata>>(info_ri);
46+
this->info_global = info_global;
47+
this->hybrid_step_ = info_global.hybrid_step;
4548
}
4649
Exx_LRI_Interface() = delete;
4750

@@ -138,12 +141,18 @@ class Exx_LRI_Interface
138141
double etot_last_outer_loop = 0.0;
139142
elecstate::DensityMatrix<T, double>* dm_last_step;
140143

144+
size_t hybrid_step() const { return hybrid_step_; }
145+
void set_hybrid_step(size_t s) { hybrid_step_ = s; }
146+
141147
std::shared_ptr<Exx_LRI<Tdata>> exx_ptr;
142148

143149
private:
144150

145151
Mix_DMk_2D<T> mix_DMk_2D;
146152

153+
Exx_Info_Global info_global;
154+
size_t hybrid_step_ = 1;
155+
147156
bool exx_spacegroup_symmetry = false;
148157
ModuleSymmetry::Symmetry_rotation symrot_;
149158

source/source_lcao/module_ri/Exx_LRI_interface.hpp

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "source_base/formatter.h"
55
#include "source_base/parallel_common.h"
66
#include "source_estate/elecstate_lcao.h"
7-
#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info
87
#include "source_hamilt/module_xc/xc_functional.h"
98
#include "source_io/module_hs/write_HS_sparse.h"
109
#include "source_io/module_output/csr_reader.h"
@@ -136,7 +135,7 @@ void Exx_LRI_Interface<T, Tdata>::exx_beforescf(const int istep,
136135
{
137136
ModuleBase::TITLE("Exx_LRI_Interface","exx_beforescf");
138137
#ifdef __MPI
139-
if (GlobalC::exx_info.info_global.cal_exx)
138+
if (this->info_global.cal_exx)
140139
{
141140
if ((GlobalC::restart.info_load.load_H_finish && !GlobalC::restart.info_load.restart_exx)
142141
|| (istep > 0)
@@ -153,15 +152,15 @@ void Exx_LRI_Interface<T, Tdata>::exx_beforescf(const int istep,
153152
}
154153

155154
// set initial parameter for mix_DMk_2D
156-
if(GlobalC::exx_info.info_global.cal_exx)
155+
if(this->info_global.cal_exx)
157156
{
158157
if (this->exx_spacegroup_symmetry)
159158
{ this->mix_DMk_2D.set_nks(kv.get_nkstot_full() * (PARAM.inp.nspin == 2 ? 2 : 1)); }
160159
else
161160
{ this->mix_DMk_2D.set_nks(kv.get_nks()); }
162161

163-
if (GlobalC::exx_info.info_global.separate_loop)
164-
{ this->mix_DMk_2D.set_mixing_plain(GlobalC::exx_info.info_global.mixing_beta_for_loop1); }
162+
if (this->info_global.separate_loop)
163+
{ this->mix_DMk_2D.set_mixing_plain(this->info_global.mixing_beta_for_loop1); }
165164
else
166165
{ this->mix_DMk_2D.set_mixing(chgmix.get_mixing()); }
167166

@@ -179,13 +178,13 @@ void Exx_LRI_Interface<T, Tdata>::exx_eachiterinit(const int istep,
179178
const int& iter)
180179
{
181180
ModuleBase::TITLE("Exx_LRI_Interface","exx_eachiterinit");
182-
if (GlobalC::exx_info.info_global.cal_exx)
181+
if (this->info_global.cal_exx)
183182
{
184-
if (!GlobalC::exx_info.info_global.separate_loop
183+
if (!this->info_global.separate_loop
185184
&& (this->two_level_step
186185
|| istep > 0
187186
|| PARAM.inp.init_wfc == "file") // non separate loop case
188-
|| (GlobalC::exx_info.info_global.separate_loop
187+
|| (this->info_global.separate_loop
189188
&& PARAM.inp.init_wfc == "file"
190189
&& this->two_level_step == 0
191190
&& iter == 1)
@@ -207,7 +206,7 @@ void Exx_LRI_Interface<T, Tdata>::exx_eachiterinit(const int istep,
207206
*dm_in.get_paraV_pointer(),
208207
PARAM.inp.nspin,
209208
this->exx_spacegroup_symmetry);
210-
if(this->exx_spacegroup_symmetry && GlobalC::exx_info.info_ri.exx_symmetry_realspace)
209+
if(this->exx_spacegroup_symmetry && this->exx_ptr->info.exx_symmetry_realspace)
211210
{ this->cal_exx_elec(Ds, ucell,*dm_in.get_paraV_pointer(), &this->symrot_); }
212211
else
213212
{ this->cal_exx_elec(Ds, ucell,*dm_in.get_paraV_pointer()); }
@@ -241,10 +240,10 @@ void Exx_LRI_Interface<T, Tdata>::exx_hamilt2rho(elecstate::ElecState& elec, con
241240
{ std::cout << "WARNING: Cannot read Eexx from disk, the energy of the 1st loop will be wrong, sbut it does not influence the subsequent loops." << std::endl; }
242241
}
243242
Parallel_Common::bcast_double(this->exx_ptr->Eexx);
244-
this->exx_ptr->Eexx /= GlobalC::exx_info.info_global.hybrid_alpha;
243+
this->exx_ptr->Eexx /= this->info_global.hybrid_alpha;
245244
}
246-
bool cal_exx = GlobalC::exx_info.info_global.cal_exx;
247-
double hybrid_alpha = GlobalC::exx_info.info_global.hybrid_alpha;
245+
bool cal_exx = this->info_global.cal_exx;
246+
double hybrid_alpha = this->info_global.hybrid_alpha;
248247
elec.set_exx(this->get_Eexx(), cal_exx, hybrid_alpha);
249248
}
250249
else
@@ -267,7 +266,7 @@ void Exx_LRI_Interface<T, Tdata>::exx_iter_finish(const K_Vectors& kv,
267266
{
268267
ModuleBase::TITLE("Exx_LRI_Interface","exx_iter_finish");
269268
if (GlobalC::restart.info_save.save_H && (this->two_level_step > 0 || istep > 0)
270-
&& (!GlobalC::exx_info.info_global.separate_loop || iter == 1)) // to avoid saving the same value repeatedly
269+
&& (!this->info_global.separate_loop || iter == 1)) // to avoid saving the same value repeatedly
271270
{
272271
////////// for Add_Hexx_Type::k
273272
/*
@@ -296,13 +295,13 @@ void Exx_LRI_Interface<T, Tdata>::exx_iter_finish(const K_Vectors& kv,
296295
}
297296
}
298297

299-
if (GlobalC::exx_info.info_global.cal_exx && conv_esolver)
298+
if (this->info_global.cal_exx && conv_esolver)
300299
{
301300
// Kerker mixing does not work for the density matrix.
302301
// In the separate loop case, it can still work in the subsequent inner loops where Hexx(DM) is fixed.
303302
// In the non-separate loop case where Hexx(DM) is updated in every iteration of the 2nd loop, it should be
304303
// closed.
305-
if (!GlobalC::exx_info.info_global.separate_loop)
304+
if (!this->info_global.separate_loop)
306305
{
307306
chgmix.close_kerker_gg0();
308307
}
@@ -333,7 +332,7 @@ bool Exx_LRI_Interface<T, Tdata>::exx_after_converge(
333332
const int& istep,
334333
const double& etot,
335334
const double& scf_ene_thr)
336-
{ // only called if (GlobalC::exx_info.info_global.cal_exx)
335+
{ // only called if (this->info_global.cal_exx)
337336
ModuleBase::TITLE("Exx_LRI_Interface","exx_after_converge");
338337
auto restart_reset = [this]()
339338
{ // avoid calling restart related procedure in the subsequent ion steps
@@ -342,9 +341,9 @@ bool Exx_LRI_Interface<T, Tdata>::exx_after_converge(
342341
};
343342

344343
// no separate_loop case
345-
if (!GlobalC::exx_info.info_global.separate_loop)
344+
if (!this->info_global.separate_loop)
346345
{
347-
GlobalC::exx_info.info_global.hybrid_step = 1;
346+
this->hybrid_step_ = 1;
348347

349348
// in no_separate_loop case, scf loop only did twice
350349
// in first scf loop, exx updated once in beginning,
@@ -371,7 +370,7 @@ bool Exx_LRI_Interface<T, Tdata>::exx_after_converge(
371370
if (two_level_step)
372371
{ std::cout << FmtCore::format(" deltaE (eV) from outer loop: %.8e \n", ediff); }
373372
// exx converged or get max exx steps
374-
if (this->two_level_step == GlobalC::exx_info.info_global.hybrid_step
373+
if (this->two_level_step == this->hybrid_step_
375374
|| (iter == 1 && this->two_level_step != 0) // density convergence of outer loop
376375
|| (ediff < scf_ene_thr && this->two_level_step != 0)) //energy convergence of outer loop
377376
{
@@ -403,7 +402,7 @@ bool Exx_LRI_Interface<T, Tdata>::exx_after_converge(
403402
*dm.get_paraV_pointer(),
404403
nspin,
405404
this->exx_spacegroup_symmetry);
406-
if(this->exx_spacegroup_symmetry && GlobalC::exx_info.info_ri.exx_symmetry_realspace)
405+
if(this->exx_spacegroup_symmetry && this->exx_ptr->info.exx_symmetry_realspace)
407406
{ this->cal_exx_elec(Ds, ucell, *dm.get_paraV_pointer(), &this->symrot_); }
408407
else
409408
{ this->cal_exx_elec(Ds, ucell, *dm.get_paraV_pointer()); } // restore DM but not Hexx
@@ -418,7 +417,7 @@ bool Exx_LRI_Interface<T, Tdata>::exx_after_converge(
418417
<< std::defaultfloat << " (s)" << std::endl;
419418
return false;
420419
}
421-
} // if(GlobalC::exx_info.info_global.separate_loop)
420+
} // if(this->info_global.separate_loop)
422421
restart_reset();
423422
return true;
424423
}

source/source_lcao/module_ri/LRI_CV.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "source_basis/module_ao/ORB_atomic_lm.h"
1212
#include "abfs-vector3_order.h"
1313
#include "source_base/element_basis_index.h"
14+
#include "source_hamilt/module_xc/exx_info_ri.h"
1415

1516
#include <RI/global/Tensor.h>
1617
#include <RI/global/Global_Func-2.h>
@@ -33,6 +34,8 @@ class LRI_CV
3334
LRI_CV();
3435
~LRI_CV();
3536

37+
void set_info_ri(const Exx_Info_RI* p) { p_info_ri = p; }
38+
3639
void set_orbitals(
3740
const UnitCell &ucell,
3841
const LCAO_Orbitals& orb,
@@ -72,6 +75,7 @@ class LRI_CV
7275
ModuleBase::Element_Basis_Index::IndexLNM index_abfs;
7376
std::vector<double> lcaos_rcut;
7477
std::vector<double> abfs_ccp_rcut;
78+
const Exx_Info_RI* p_info_ri = nullptr;
7579

7680
public:
7781
std::map<int,std::map<int,std::map<Abfs::Vector3_Order<double>,RI::Tensor<Tdata>>>> Vws;

source/source_lcao/module_ri/LRI_CV.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "../../source_basis/module_ao/element_basis_index-ORB.h"
1414
#include "../../source_base/tool_title.h"
1515
#include "../../source_base/timer.h"
16-
#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info
16+
#include "source_hamilt/module_xc/exx_info_ri.h"
1717
#include <RI/global/Global_Func-1.h>
1818
#include <omp.h>
1919

@@ -353,8 +353,9 @@ LRI_CV<Tdata>::DPcal_C_dC(
353353
Matrix_Orbs21::Matrix_Order::A1A2B);
354354
const RI::Tensor<Tdata> V = this->DPcal_V(it0, it0, {0, 0, 0}, {{"writable_Vws", true}});
355355
RI::Tensor<Tdata> L;
356-
if (GlobalC::exx_info.info_ri.Cs_inv_thr > 0)
357-
L = LRI_CV_Tools::cal_I(V, Inverse_Matrix<Tdata>::Method::syev, GlobalC::exx_info.info_ri.Cs_inv_thr);
356+
const double cs_inv_thr = this->p_info_ri != nullptr ? this->p_info_ri->Cs_inv_thr : 0.0;
357+
if (cs_inv_thr > 0)
358+
L = LRI_CV_Tools::cal_I(V, Inverse_Matrix<Tdata>::Method::syev, cs_inv_thr);
358359
else
359360
L = LRI_CV_Tools::cal_I(V);
360361

@@ -405,8 +406,9 @@ LRI_CV<Tdata>::DPcal_C_dC(
405406
DPcal_V(it1, it1, {0,0,0}, {{"writable_Vws",true}})}};
406407

407408
std::vector<std::vector<RI::Tensor<Tdata>>> L;
408-
if (GlobalC::exx_info.info_ri.Cs_inv_thr > 0)
409-
L = LRI_CV_Tools::cal_I(V, Inverse_Matrix<Tdata>::Method::syev, GlobalC::exx_info.info_ri.Cs_inv_thr);
409+
const double cs_inv_thr = this->p_info_ri != nullptr ? this->p_info_ri->Cs_inv_thr : 0.0;
410+
if (cs_inv_thr > 0)
411+
L = LRI_CV_Tools::cal_I(V, Inverse_Matrix<Tdata>::Method::syev, cs_inv_thr);
410412
else
411413
L = LRI_CV_Tools::cal_I(V);
412414

source/source_lcao/module_ri/RPA_LRI.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ template <typename T, typename Tdata> class RPA_LRI
8383
Tdata Erpa;
8484

8585
private:
86-
// WARNING: reference to Exx_Info_RI, which holds references into Exx_Info_Global.
87-
// Must not outlive GlobalC::exx_info. See exx_info.h for details.
88-
const Exx_Info_RI &info;
86+
Exx_Info_RI info;
8987
const K_Vectors *p_kv=nullptr;
9088
MPI_Comm mpi_comm;
9189
std::vector<double> orb_cutoff_;
@@ -109,7 +107,6 @@ template <typename T, typename Tdata> class RPA_LRI
109107
Exx_LRI<double>* exx_cut_coulomb = nullptr;
110108
Exx_LRI<double>* exx_full_coulomb = nullptr;
111109
};
112-
Exx_LRI<double> exx_lri_rpa(GlobalC::exx_info.info_ri);
113110
#include "RPA_LRI.hpp"
114111

115112
#endif

0 commit comments

Comments
 (0)