Skip to content

Commit 8ea2669

Browse files
codexAroundPeking
authored andcommitted
fix(input): shorten LibRPA reader parameter
1 parent 1a30411 commit 8ea2669

8 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎source/source_io/module_parameter/input_parameter.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ struct Input_para
643643
double shrink_LU_inv_thr = 1e-6; ///< threshold to get inverse of overlap matrix by LU decomposition in auxiliary basis representation
644644
bool out_ri_cv = false; ///< Whether to output the coefficient tensor C and ABFs-representation Coulomb matrix V
645645
bool out_unshrinked_v = false; ///< whether to output the large Vq matrix in unshrinked auxiliary basis
646-
int out_librpa_reader_version = 0; ///< 0: legacy ABACUS LibRPA text files; 1: LibRPA reader-v1 binary files
646+
int out_librpa_ver = 0; ///< 0: legacy ABACUS LibRPA text files; 1: LibRPA reader-v1 binary files
647647
bool exx_coul_moment = false; ///< whether to use moment method for Coulomb calculation
648648
bool exx_rotate_abfs = false; ///< whether to rotate auxiliary basis for Coulomb calculation
649649
double exx_multip_moments_threshold = 1e-10; ///< threshold to screen multipole moments in Coulomb calculation

‎source/source_io/module_parameter/read_inp_out.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,9 +1513,9 @@ If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or r
15131513
item.default_value = "0";
15141514
item.unit = "";
15151515
item.set_availability("basis_type==lcao");
1516-
read_sync_int(input.out_librpa_reader_version);
1516+
read_sync_int(input.out_librpa_ver);
15171517
item.check_value = [](const Input_Item&, const Parameter& para) {
1518-
const int value = para.input.out_librpa_reader_version;
1518+
const int value = para.input.out_librpa_ver;
15191519
if (value != 0 && value != 1)
15201520
{
15211521
ModuleBase::WARNING_QUIT("INPUT", "out_librpa_ver must be 0 or 1.");

‎source/source_io/test/read_input_ptest.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ TEST_F(InputParaTest, ParaRead)
307307
EXPECT_DOUBLE_EQ(param.inp.exx_v_grad_r_threshold, 0);
308308
EXPECT_EQ(param.inp.exx_ccp_rmesh_times, "1.5");
309309
EXPECT_DOUBLE_EQ(param.inp.rpa_ccp_rmesh_times, 10.0);
310-
EXPECT_EQ(param.inp.out_librpa_reader_version, 1);
310+
EXPECT_EQ(param.inp.out_librpa_ver, 1);
311311
EXPECT_EQ(param.inp.exx_opt_orb_lmax, 0);
312312
EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_ecut, 0.0);
313313
EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_tolerence, 0.0);

‎source/source_io/test_serial/read_input_item_test.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,13 +1822,13 @@ TEST_F(InputTest, Item_test2)
18221822
{ // out_librpa_ver
18231823
auto it = find_label("out_librpa_ver", readinput.input_lists);
18241824
ASSERT_NE(it, readinput.input_lists.end());
1825-
EXPECT_EQ(TestParameters::input(param).out_librpa_reader_version, 0);
1825+
EXPECT_EQ(TestParameters::input(param).out_librpa_ver, 0);
18261826

18271827
it->second.str_values = {"1"};
18281828
it->second.read_value(it->second, param);
1829-
EXPECT_EQ(TestParameters::input(param).out_librpa_reader_version, 1);
1829+
EXPECT_EQ(TestParameters::input(param).out_librpa_ver, 1);
18301830

1831-
TestParameters::input(param).out_librpa_reader_version = 2;
1831+
TestParameters::input(param).out_librpa_ver = 2;
18321832
testing::internal::CaptureStdout();
18331833
EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), "");
18341834
output = testing::internal::GetCapturedStdout();

‎source/source_lcao/module_ri/rpa_lri_coulomb.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void RPA_LRI<T, Tdata>::output_cut_coulomb_cs(const UnitCell& ucell, Exx_LRI<dou
314314
Vs_cut_IJR.clear();
315315
const std::array<Tcell, Ndim> period = {p_kv->nmp[0], p_kv->nmp[1], p_kv->nmp[2]};
316316
this->Vs_period = RI::RI_Tools::cal_period(Vs_cut_IJ, period);
317-
if (this->runtime.input.out_librpa_reader_version == 1)
317+
if (this->runtime.input.out_librpa_ver == 1)
318318
{
319319
const bool use_shrink = this->info.shrink_abfs_pca_thr >= 0.0;
320320
this->out_librpa_basis_v1(ucell,
@@ -333,7 +333,7 @@ void RPA_LRI<T, Tdata>::output_cut_coulomb_cs(const UnitCell& ucell, Exx_LRI<dou
333333
this->Cs_period = RI::RI_Tools::cal_period(Cs, period);
334334
this->Cs_period = exx_lri_rpa->exx_lri.post_2D.set_tensors_map2(this->Cs_period);
335335

336-
if (this->runtime.input.out_librpa_reader_version == 1)
336+
if (this->runtime.input.out_librpa_ver == 1)
337337
{
338338
if (this->info.shrink_abfs_pca_thr >= 0.0)
339339
{
@@ -434,7 +434,7 @@ void RPA_LRI<T, Tdata>::output_ewald_coulomb(const UnitCell& ucell, const K_Vect
434434

435435
const std::array<Tcell, Ndim> period = {p_kv->nmp[0], p_kv->nmp[1], p_kv->nmp[2]};
436436
this->Vs_period = RI::RI_Tools::cal_period(Vs_full_IJ, period);
437-
if (this->runtime.input.out_librpa_reader_version == 1)
437+
if (this->runtime.input.out_librpa_ver == 1)
438438
{
439439
const bool use_shrink = this->info.shrink_abfs_pca_thr >= 0.0;
440440
this->out_librpa_basis_v1(ucell,

‎source/source_lcao/module_ri/rpa_lri_output.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// Reader-v1 stores k-point sampling in bz_sample.txt. Keep the legacy
1111
// k-point block in stru_out.txt for reader-v0 consumers.
12-
if (this->runtime.input.out_librpa_reader_version != 1)
12+
if (this->runtime.input.out_librpa_ver != 1)
1313
{
1414
ofs << p_kv->nmp[0] << std::setw(6) << p_kv->nmp[1] << std::setw(6) << p_kv->nmp[2]
1515
<< std::setw(6) << std::endl;

‎source/source_lcao/module_ri/rpa_lri_overlap.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void RPA_LRI<T, Tdata>::cal_large_Cs(const UnitCell& ucell, const LCAO_Orbitals&
110110
std::map<TA, std::map<TAC, RI::Tensor<Tdata>>>& Cs = std::get<0>(Cs_dCs);
111111
this->Cs_period = RI::RI_Tools::cal_period(Cs, period);
112112
this->Cs_period = exx_cut_coulomb->exx_lri.post_2D.set_tensors_map2(this->Cs_period);
113-
if (this->runtime.input.out_librpa_reader_version == 1)
113+
if (this->runtime.input.out_librpa_ver == 1)
114114
{
115115
this->out_librpa_basis_v1(ucell,
116116
exx_cut_coulomb.get(),
@@ -286,7 +286,7 @@ void RPA_LRI<T, Tdata>::cal_abfs_overlap(const UnitCell& ucell, const LCAO_Orbit
286286
= RI_2D_Comm::comm_map2_first(mpi_comm, overlap_abfs_abf, atoms00, atoms01);
287287
overlap_abfs_abf.clear();
288288

289-
if (this->runtime.input.out_librpa_reader_version == 1)
289+
if (this->runtime.input.out_librpa_ver == 1)
290290
{
291291
out_abfs_overlap_v1(ucell, overlap_abfs_abfs_IJ, overlap_abfs_abf_IJ,
292292
"sinvS_", index_abfs_s, index_abfs);

‎source/source_lcao/module_ri/rpa_lri_overlap_io.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ void RPA_LRI<T, Tdata>::out_eigen_vector(const Parallel_Orbitals& parav, const p
428428
const int nbasis = parav.get_wfc_global_nbasis();
429429
const std::size_t values_per_iw = static_cast<std::size_t>(nbands) * npsin_tmp;
430430

431-
if (this->runtime.input.out_librpa_reader_version == 1)
431+
if (this->runtime.input.out_librpa_ver == 1)
432432
{
433433
#ifdef __MPI
434434
ModuleBase::timer::start("RPA_LRI", "out_eigen_vector_v1_mpi_io");

0 commit comments

Comments
 (0)