Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions source/module_esolver/esolver_ks_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,27 +565,25 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
//------------------------------------------------------------------
ESolver_KS<T, Device>::after_scf(ucell, istep, conv_esolver);


//------------------------------------------------------------------
// 3) output wavefunctions in pw basis
//------------------------------------------------------------------
if (PARAM.inp.out_wfc_pw == 1 || PARAM.inp.out_wfc_pw == 2)
{
std::stringstream ssw;
ssw << PARAM.globalv.global_out_dir << "WAVEFUNC";
ModuleIO::write_wfc_pw(ssw.str(), this->psi[0], this->kv, this->pw_wfc);
}

//------------------------------------------------------------------
// 4) transfer data from GPU to CPU in pw basis
// a question: the wavefunctions have been output, then the data transfer occurs? mohan 20250302
// 3) transfer data from GPU to CPU in pw basis
//------------------------------------------------------------------
if (this->device == base_device::GpuDevice)
{
castmem_2d_d2h_op()(this->psi[0].get_pointer() - this->psi[0].get_psi_bias(),
this->kspw_psi[0].get_pointer() - this->kspw_psi[0].get_psi_bias(),
this->psi[0].size());
}

//------------------------------------------------------------------
// 4) output wavefunctions in pw basis
//------------------------------------------------------------------
if (PARAM.inp.out_wfc_pw == 1 || PARAM.inp.out_wfc_pw == 2)
{
std::stringstream ssw;
ssw << PARAM.globalv.global_out_dir << "WAVEFUNC";
ModuleIO::write_wfc_pw(ssw.str(), this->psi[0], this->kv, this->pw_wfc);
}

//------------------------------------------------------------------
// 5) calculate band-decomposed (partial) charge density in pw basis
Expand Down
Loading