Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianruipku committed Jan 22, 2025
1 parent c5dc8ce commit e41207b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions source/module_base/test_parallel/parallel_global_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MPIContext
int rank_in_pool;

int nstogroup;
int my_stogroup;
int MY_BNDGROUP;
int rank_in_stogroup;
int nproc_in_stogroup;

Expand Down Expand Up @@ -173,7 +173,7 @@ TEST_F(ParaGlobal, InitPools)
mpi.kpar,
mpi.nproc_in_stogroup,
mpi.rank_in_stogroup,
mpi.my_stogroup,
mpi.MY_BNDGROUP,
mpi.nproc_in_pool,
mpi.rank_in_pool,
mpi.my_pool), ::testing::ExitedWithCode(1), "");
Expand Down
2 changes: 1 addition & 1 deletion source/module_cell/cal_atoms_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CalAtomsInfo
elecstate::cal_nbands(para.inp.nelec, para.sys.nlocal, nelec_spin, para.input.nbands);
// calculate the number of nbands_local
para.sys.nbands_l = para.inp.nbands;
if (inp.ks_solver == "bpcg") // only bpcg support band parallel
if (para.inp.ks_solver == "bpcg") // only bpcg support band parallel
{
para.sys.nbands_l = para.inp.nbands / para.inp.bndpar;
if (GlobalV::RANK_IN_BPGROUP < para.inp.nbands % para.inp.bndpar)
Expand Down
4 changes: 2 additions & 2 deletions source/module_cell/test/klist_test_para.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ TEST_F(KlistParaTest, Set)
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_STOGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
Expand Down Expand Up @@ -288,7 +288,7 @@ TEST_F(KlistParaTest, SetAfterVC)
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_STOGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
Expand Down
6 changes: 3 additions & 3 deletions source/module_elecstate/test_mpi/charge_mpi_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ TEST_F(ChargeMpiTest, reduce_diff_pools1)
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_STOGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
Expand Down Expand Up @@ -118,7 +118,7 @@ TEST_F(ChargeMpiTest, reduce_diff_pools2)
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_STOGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
Expand Down Expand Up @@ -173,7 +173,7 @@ TEST_F(ChargeMpiTest, rho_mpi)
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_STOGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
Expand Down
4 changes: 2 additions & 2 deletions source/module_hsolver/test/test_hsolver_sdft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class TestHSolverPW_SDFT : public ::testing::Test
// stowf.nchip_max = 0;
// psi_test_cd.resize(1, 2, 3);
// PARAM.input.nelec = 1.0;
// GlobalV::MY_STOGROUP = 0.0;
// GlobalV::MY_BNDGROUP = 0.0;
// int istep = 0;
// int iter = 0;

Expand Down Expand Up @@ -291,7 +291,7 @@ class TestHSolverPW_SDFT : public ::testing::Test
// psi_test_no.nbands = 0;
// psi_test_no.nbasis = 0;
// PARAM.input.nelec = 1.0;
// GlobalV::MY_STOGROUP = 0.0;
// GlobalV::MY_BNDGROUP = 0.0;
// PARAM.input.nspin = 1;
// elecstate_test.charge = new Charge;
// elecstate_test.charge->rho = new double*[1];
Expand Down
2 changes: 1 addition & 1 deletion source/module_io/test/read_wfc_to_rho_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ int main(int argc, char** argv)
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_STOGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
Expand Down
4 changes: 2 additions & 2 deletions source/module_io/test/write_istate_info_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TEST_F(IstateInfoTest, OutIstateInfoS1)
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_STOGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
Expand Down Expand Up @@ -105,7 +105,7 @@ TEST_F(IstateInfoTest, OutIstateInfoS2)
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_STOGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
Expand Down
10 changes: 5 additions & 5 deletions source/module_io/test_serial/io_system_variable_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST_F(InputTest, Item_test)

{
param.input.suffix = "test";
readinput.set_globalv(param);
readinput.set_globalv(param.inp, param.sys);
EXPECT_EQ(param.sys.global_out_dir, "OUT.test/");
EXPECT_EQ(param.sys.global_stru_dir, "OUT.test/STRU/");
EXPECT_EQ(param.sys.global_matrix_dir, "OUT.test/matrix/");
Expand All @@ -53,25 +53,25 @@ TEST_F(InputTest, Item_test)
param.input.gamma_only = true;
param.input.esolver_type = "tddft";
param.input.nspin = 2;
readinput.set_globalv(param);
readinput.set_globalv(param.inp, param.sys);
EXPECT_EQ(param.sys.gamma_only_local, 0);

param.input.deepks_scf = true;
param.input.deepks_out_labels = true;
readinput.set_globalv(param);
readinput.set_globalv(param.inp, param.sys);
EXPECT_EQ(param.sys.deepks_setorb, 1);

param.input.nspin = 4;
param.input.noncolin = true;
readinput.set_globalv(param);
readinput.set_globalv(param.inp, param.sys);
EXPECT_EQ(param.sys.domag, 1);
EXPECT_EQ(param.sys.domag_z, 0);
EXPECT_EQ(param.sys.npol, 2);

param.input.nspin = 1;
param.input.lspinorb = true;
param.input.noncolin = false;
readinput.set_globalv(param);
readinput.set_globalv(param.inp, param.sys);
EXPECT_EQ(param.sys.domag, 0);
EXPECT_EQ(param.sys.domag_z, 0);
EXPECT_EQ(param.sys.npol, 1);
Expand Down
2 changes: 1 addition & 1 deletion source/module_psi/psi_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void PSIInit<T, Device>::prepare_init(const int& random_seed)
// use new instead, but will cause asymmetric allocation and deallocation, in literal aspect
ModuleBase::timer::tick("PSIInit", "prepare_init");
this->psi_initer.reset();
if (this->init_wfc == "random" || (PARAM.ks_solver == "bpcg" && PARAM.inp.bndpar > 1))
if (this->init_wfc == "random" || (PARAM.inp.ks_solver == "bpcg" && PARAM.inp.bndpar > 1))
{ //temporary solution for band parallel bpcg
this->psi_initer = std::unique_ptr<psi_initializer<T>>(new psi_initializer_random<T>());
}
Expand Down

0 comments on commit e41207b

Please sign in to comment.