Skip to content

Commit 0145476

Browse files
committed
change to get_current_ngk
1 parent cf09808 commit 0145476

File tree

13 files changed

+22
-22
lines changed

13 files changed

+22
-22
lines changed

source/module_elecstate/elecstate_pw.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void ElecStatePW<T, Device>::rhoBandK(const psi::Psi<T, Device>& psi)
183183

184184
this->init_rho_data();
185185
int ik = psi.get_current_k();
186-
int npw = psi.get_cur_effective_basis();
186+
int npw = psi.get_current_ngk();
187187
int current_spin = 0;
188188
if (PARAM.inp.nspin == 2)
189189
{
@@ -287,7 +287,7 @@ void ElecStatePW<T, Device>::cal_becsum(const psi::Psi<T, Device>& psi)
287287
psi.fix_k(ik);
288288
const T* psi_now = psi.get_pointer();
289289
const int currect_spin = this->klist->isk[ik];
290-
const int npw = psi.get_cur_effective_basis();
290+
const int npw = psi.get_current_ngk();
291291

292292
// get |beta>
293293
if (this->ppcell->nkb > 0)

source/module_elecstate/elecstate_pw_cal_tau.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void ElecStatePW<T, Device>::cal_tau(const psi::Psi<T, Device>& psi)
1515
for (int ik = 0; ik < psi.get_nk(); ++ik)
1616
{
1717
psi.fix_k(ik);
18-
int npw = psi.get_cur_effective_basis();
18+
int npw = psi.get_current_ngk();
1919
int current_spin = 0;
2020
if (PARAM.inp.nspin == 2)
2121
{

source/module_hamilt_pw/hamilt_stodft/sto_iter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void Stochastic_Iter<T, Device>::orthog(const int& ik, psi::Psi<T, Device>& psi,
6060
if (PARAM.inp.nbands > 0)
6161
{
6262
const int nchipk = stowf.nchip[ik];
63-
const int npw = psi.get_cur_effective_basis();
63+
const int npw = psi.get_current_ngk();
6464
const int npwx = psi.get_nbasis();
6565
stowf.chi0->fix_k(ik);
6666
stowf.chiortho->fix_k(ik);

source/module_hsolver/diago_iter_assist.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void DiagoIterAssist<T, Device>::diagH_subspace(const hamilt::Hamilt<T, Device>*
4949
setmem_complex_op()(ctx, scc, 0, nstart * nstart);
5050
setmem_complex_op()(ctx, vcc, 0, nstart * nstart);
5151

52-
const int dmin = psi.get_cur_effective_basis();
52+
const int dmin = psi.get_current_ngk();
5353
const int dmax = psi.get_nbasis();
5454

5555
T* temp = nullptr;
@@ -167,7 +167,7 @@ void DiagoIterAssist<T, Device>::diagH_subspace_init(hamilt::Hamilt<T, Device>*
167167
const int nstart = psi_nr;
168168
const int n_band = evc.get_nbands();
169169
const int dmax = evc.get_nbasis();
170-
const int dmin = evc.get_cur_effective_basis();
170+
const int dmin = evc.get_current_ngk();
171171

172172
// skip the diagonalization if the operators are not allocated
173173
if (pHamilt->ops == nullptr)
@@ -425,7 +425,7 @@ void DiagoIterAssist<T, Device>::cal_hs_subspace(const hamilt::Hamilt<T, Device>
425425
setmem_complex_op()(ctx, hcc, 0, nstart * nstart);
426426
setmem_complex_op()(ctx, scc, 0, nstart * nstart);
427427

428-
const int dmin = psi.get_cur_effective_basis();
428+
const int dmin = psi.get_current_ngk();
429429
const int dmax = psi.get_nbasis();
430430

431431
T* temp = nullptr;
@@ -551,7 +551,7 @@ void DiagoIterAssist<T, Device>::diag_subspace_psi(const T* hcc,
551551
DiagoIterAssist::diagH_LAPACK(nstart, nstart, hcc, scc, nstart, en, vcc);
552552

553553
{ // code block to calculate tar_mat
554-
const int dmin = evc.get_cur_effective_basis();
554+
const int dmin = evc.get_current_ngk();
555555
const int dmax = evc.get_nbasis();
556556
T* temp = nullptr;
557557
resmem_complex_op()(ctx, temp, nstart * dmax, "DiagSub::temp");

source/module_hsolver/hsolver_pw.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
473473
ct::DeviceTypeToEnum<ct::DEVICE_CPU>::value,
474474
ct::TensorShape({static_cast<int>(pre_condition.size())}))
475475
.to_device<ct_Device>()
476-
.slice({0}, {psi.get_cur_effective_basis()});
476+
.slice({0}, {psi.get_current_ngk()});
477477

478478
cg.diag(hpsi_func, spsi_func, psi_tensor, eigen_tensor, this->ethr_band, prec_tensor);
479479
// TODO: Double check tensormap's potential problem
@@ -523,7 +523,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
523523

524524
Diago_DavSubspace<T, Device> dav_subspace(pre_condition,
525525
psi.get_nbands(),
526-
psi.get_k_first() ? psi.get_cur_effective_basis()
526+
psi.get_k_first() ? psi.get_current_ngk()
527527
: psi.get_nk() * psi.get_nbasis(),
528528
PARAM.inp.pw_diag_ndim,
529529
this->diag_thr,
@@ -549,7 +549,7 @@ void HSolverPW<T, Device>::hamiltSolvePsiK(hamilt::Hamilt<T, Device>* hm,
549549
const int david_maxiter = this->diag_iter_max;
550550

551551
// dimensions of matrix to be solved
552-
const int dim = psi.get_cur_effective_basis(); /// dimension of matrix
552+
const int dim = psi.get_current_ngk(); /// dimension of matrix
553553
const int nband = psi.get_nbands(); /// number of eigenpairs sought
554554
const int ld_psi = psi.get_nbasis(); /// leading dimension of psi
555555

source/module_hsolver/test/diago_cg_float_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class DiagoCGPrepare
182182
psi_local.get_pointer(),
183183
ct::DataType::DT_COMPLEX,
184184
ct::DeviceType::CpuDevice,
185-
ct::TensorShape({psi_local.get_nbands(), psi_local.get_nbasis()})).slice({0, 0}, {psi_local.get_nbands(), psi_local.get_cur_effective_basis()});
185+
ct::TensorShape({psi_local.get_nbands(), psi_local.get_nbasis()})).slice({0, 0}, {psi_local.get_nbands(), psi_local.get_current_ngk()});
186186
auto eigen_tensor = ct::TensorMap(
187187
en,
188188
ct::DataType::DT_FLOAT,
@@ -192,7 +192,7 @@ class DiagoCGPrepare
192192
precondition_local,
193193
ct::DataType::DT_FLOAT,
194194
ct::DeviceType::CpuDevice,
195-
ct::TensorShape({static_cast<int>(psi_local.get_cur_effective_basis())})).slice({0}, {psi_local.get_cur_effective_basis()});
195+
ct::TensorShape({static_cast<int>(psi_local.get_current_ngk())})).slice({0}, {psi_local.get_current_ngk()});
196196

197197
std::vector<double> ethr_band(nband, 1e-5);
198198
cg.diag(hpsi_func, spsi_func, psi_tensor, eigen_tensor, ethr_band, prec_tensor);

source/module_hsolver/test/diago_cg_real_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class DiagoCGPrepare
185185
psi_local.get_pointer(),
186186
ct::DataType::DT_DOUBLE,
187187
ct::DeviceType::CpuDevice,
188-
ct::TensorShape({psi_local.get_nbands(), psi_local.get_nbasis()})).slice({0, 0}, {psi_local.get_nbands(), psi_local.get_cur_effective_basis()});
188+
ct::TensorShape({psi_local.get_nbands(), psi_local.get_nbasis()})).slice({0, 0}, {psi_local.get_nbands(), psi_local.get_current_ngk()});
189189
auto eigen_tensor = ct::TensorMap(
190190
en,
191191
ct::DataType::DT_DOUBLE,
@@ -195,7 +195,7 @@ class DiagoCGPrepare
195195
precondition_local,
196196
ct::DataType::DT_DOUBLE,
197197
ct::DeviceType::CpuDevice,
198-
ct::TensorShape({static_cast<int>(psi_local.get_cur_effective_basis())})).slice({0}, {psi_local.get_cur_effective_basis()});
198+
ct::TensorShape({static_cast<int>(psi_local.get_current_ngk())})).slice({0}, {psi_local.get_current_ngk()});
199199

200200
std::vector<double> ethr_band(nband, 1e-5);
201201
cg.diag(hpsi_func, spsi_func, psi_tensor, eigen_tensor, ethr_band, prec_tensor);

source/module_hsolver/test/diago_cg_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class DiagoCGPrepare
176176
psi_local.get_pointer(),
177177
ct::DataType::DT_COMPLEX_DOUBLE,
178178
ct::DeviceType::CpuDevice,
179-
ct::TensorShape({psi_local.get_nbands(), psi_local.get_nbasis()})).slice({0, 0}, {psi_local.get_nbands(), psi_local.get_cur_effective_basis()});
179+
ct::TensorShape({psi_local.get_nbands(), psi_local.get_nbasis()})).slice({0, 0}, {psi_local.get_nbands(), psi_local.get_current_ngk()});
180180
auto eigen_tensor = ct::TensorMap(
181181
en,
182182
ct::DataType::DT_DOUBLE,
@@ -186,7 +186,7 @@ class DiagoCGPrepare
186186
precondition_local,
187187
ct::DataType::DT_DOUBLE,
188188
ct::DeviceType::CpuDevice,
189-
ct::TensorShape({static_cast<int>(psi_local.get_cur_effective_basis())})).slice({0}, {psi_local.get_cur_effective_basis()});
189+
ct::TensorShape({static_cast<int>(psi_local.get_current_ngk())})).slice({0}, {psi_local.get_current_ngk()});
190190

191191
std::vector<double> ethr_band(nband, 1e-5);
192192
cg.diag(hpsi_func, spsi_func, psi_tensor, eigen_tensor, ethr_band, prec_tensor);

source/module_hsolver/test/diago_david_float_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class DiagoDavPrepare
9090
const hsolver::diag_comm_info comm_info = {mypnum, nprocs};
9191
#endif
9292

93-
const int dim = phi.get_cur_effective_basis() ;
93+
const int dim = phi.get_current_ngk() ;
9494
const int nband = phi.get_nbands();
9595
const int ld_psi =phi.get_nbasis();
9696
hsolver::DiagoDavid<std::complex<float>> dav(precondition, nband, dim, order, false, comm_info);

source/module_hsolver/test/diago_david_real_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class DiagoDavPrepare
8989
const hsolver::diag_comm_info comm_info = {mypnum, nprocs};
9090
#endif
9191

92-
const int dim = phi.get_cur_effective_basis();
92+
const int dim = phi.get_current_ngk();
9393
const int nband = phi.get_nbands();
9494
const int ld_psi = phi.get_nbasis();
9595
hsolver::DiagoDavid<double> dav(precondition, nband, dim, order, false, comm_info);

0 commit comments

Comments
 (0)