Skip to content

Commit 5f21751

Browse files
committed
fix wrong setmem
1 parent 2a823cd commit 5f21751

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

source/module_hamilt_general/operator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Operator
5757
///do operation : |hpsi_choosed> = V|psi_choosed>
5858
///V is the target operator act on choosed psi, the consequence should be added to choosed hpsi
5959
/// interface type 1: pointer-only (default)
60+
/// @note PW: nbasis = max_npw * npol, nbands = nband * npol, npol = npol. Strange but PAY ATTENTION!!!
6061
virtual void act(const int nbands,
6162
const int nbasis,
6263
const int npol,

source/module_hamilt_pw/hamilt_pwdft/operator_pw/meta_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void Meta<OperatorPW<T, Device>>::act(
5454
ModuleBase::timer::tick("Operator", "MetaPW");
5555
if(is_first_node)
5656
{
57-
setmem_complex_op()(this->ctx, tmhpsi, 0, nbasis*nbands);
57+
setmem_complex_op()(this->ctx, tmhpsi, 0, nbasis*nbands/npol);
5858
}
5959

6060
const int current_spin = this->isk[this->ik];

source/module_hamilt_pw/hamilt_pwdft/operator_pw/nonlocal_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void Nonlocal<OperatorPW<T, Device>>::act(
220220
ModuleBase::timer::tick("Operator", "NonlocalPW");
221221
if(is_first_node)
222222
{
223-
setmem_complex_op()(this->ctx, tmhpsi, 0, nbasis*nbands);
223+
setmem_complex_op()(this->ctx, tmhpsi, 0, nbasis*nbands/npol);
224224
}
225225
if(!PARAM.inp.use_paw)
226226
{

source/module_hamilt_pw/hamilt_pwdft/operator_pw/veff_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void Veff<OperatorPW<T, Device>>::act(
4747
ModuleBase::timer::tick("Operator", "VeffPW");
4848
if(is_first_node)
4949
{
50-
setmem_complex_op()(this->ctx, tmhpsi, 0, nbasis*nbands);
50+
setmem_complex_op()(this->ctx, tmhpsi, 0, nbasis*nbands/npol);
5151
}
5252

5353
int max_npw = nbasis / npol;

0 commit comments

Comments
 (0)