Describe the bug
The vkb memory block of size (nkb, npwx) is allocated by new (CPU MEMORY),
and this snippet is called even in GPU branch.
in source/source_pw/module_pwdft/vnl_pw.cpp:
if (nkb > 0 && allocate_vkb)
{
vkb.create(nkb, npwx);
ModuleBase::Memory::record("VNL::vkb", nkb * npwx * sizeof(std::complex<double>));
}
in source/source_base/complexmatrix.cpp:
// reallocate memory for Complex Matrix
void ComplexMatrix::create(const int nr_in, const int nc_in, const bool flag_zero)
{
if( nr_in && nc_in )
{
if(c)
{
const int size_in=nr_in*nc_in;
if( size_in!=nr*nc )
{
delete[] c;
c = new std::complex<double>[size_in];
}
}
else
{
c = new std::complex<double>[nr_in * nc_in];
}
nr = nr_in;
nc = nc_in;
size = nr*nc;
if(flag_zero) zero_out();
}
else
{
if(c) delete[] c;
c = nullptr;
nr = nr_in;
nc = nc_in;
size = nr*nc;
}
}
When running on GPU-like device with many atoms and huge ecutwfc, the new expression will raise a std::bad_array_new_length error.
Expected behavior
No response
To Reproduce
No response
Environment
No response
Additional Context
No response
Task list for Issue attackers (only for developers)
Describe the bug
The vkb memory block of size (nkb, npwx) is allocated by new (CPU MEMORY),
and this snippet is called even in GPU branch.
in
source/source_pw/module_pwdft/vnl_pw.cpp:in
source/source_base/complexmatrix.cpp:When running on GPU-like device with many atoms and huge ecutwfc, the
newexpression will raise astd::bad_array_new_lengtherror.Expected behavior
No response
To Reproduce
No response
Environment
No response
Additional Context
No response
Task list for Issue attackers (only for developers)