@@ -565,27 +565,25 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
565
565
// ------------------------------------------------------------------
566
566
ESolver_KS<T, Device>::after_scf (ucell, istep, conv_esolver);
567
567
568
-
569
- // ------------------------------------------------------------------
570
- // 3) output wavefunctions in pw basis
571
- // ------------------------------------------------------------------
572
- if (PARAM.inp .out_wfc_pw == 1 || PARAM.inp .out_wfc_pw == 2 )
573
- {
574
- std::stringstream ssw;
575
- ssw << PARAM.globalv .global_out_dir << " WAVEFUNC" ;
576
- ModuleIO::write_wfc_pw (ssw.str (), this ->psi [0 ], this ->kv , this ->pw_wfc );
577
- }
578
-
579
568
// ------------------------------------------------------------------
580
- // 4) transfer data from GPU to CPU in pw basis
581
- // a question: the wavefunctions have been output, then the data transfer occurs? mohan 20250302
569
+ // 3) transfer data from GPU to CPU in pw basis
582
570
// ------------------------------------------------------------------
583
571
if (this ->device == base_device::GpuDevice)
584
572
{
585
573
castmem_2d_d2h_op ()(this ->psi [0 ].get_pointer () - this ->psi [0 ].get_psi_bias (),
586
574
this ->kspw_psi [0 ].get_pointer () - this ->kspw_psi [0 ].get_psi_bias (),
587
575
this ->psi [0 ].size ());
588
576
}
577
+
578
+ // ------------------------------------------------------------------
579
+ // 4) output wavefunctions in pw basis
580
+ // ------------------------------------------------------------------
581
+ if (PARAM.inp .out_wfc_pw == 1 || PARAM.inp .out_wfc_pw == 2 )
582
+ {
583
+ std::stringstream ssw;
584
+ ssw << PARAM.globalv .global_out_dir << " WAVEFUNC" ;
585
+ ModuleIO::write_wfc_pw (ssw.str (), this ->psi [0 ], this ->kv , this ->pw_wfc );
586
+ }
589
587
590
588
// ------------------------------------------------------------------
591
589
// 5) calculate band-decomposed (partial) charge density in pw basis
0 commit comments