@@ -30,11 +30,8 @@ void evolve_psi(const int nband,
3030 std::ofstream& ofs_running,
3131 const int print_matrix)
3232{
33- ModuleBase::TITLE (" Evolve_psi" , " evolve_psi" );
34- // ofs_running << " Evolving electronic wave functions begins" << std::endl;
35-
33+ ModuleBase::TITLE (" module_rt" , " evolve_psi" );
3634 time_t time_start = time (nullptr );
37- // ofs_running << " Start Time : " << ctime(&time_start);
3835
3936#ifdef __MPI
4037
@@ -112,12 +109,10 @@ void evolve_psi(const int nband,
112109 delete[] Hold;
113110 delete[] U_operator;
114111
115- #endif
112+ #endif // __MPI
116113
117114 time_t time_end = time (nullptr );
118- ModuleBase::GlobalFunc::OUT_TIME (" evolve(std::complex)" , time_start, time_end);
119-
120- // ofs_running << " Evolving electronic wave functions ends" << std::endl;
115+ ModuleBase::GlobalFunc::OUT_TIME (" evolve_psi" , time_start, time_end);
121116
122117 return ;
123118}
@@ -137,6 +132,9 @@ void evolve_psi_tensor(const int nband,
137132 const int print_matrix,
138133 const bool use_lapack)
139134{
135+ ModuleBase::TITLE (" module_rt" , " evolve_psi_tensor" );
136+ time_t time_start = time (nullptr );
137+
140138 // ct_device_type = ct::DeviceType::CpuDevice or ct::DeviceType::GpuDevice
141139 ct::DeviceType ct_device_type = ct::DeviceTypeToEnum<Device>::value;
142140 // ct_Device = ct::DEVICE_CPU or ct::DEVICE_GPU
@@ -154,17 +152,12 @@ void evolve_psi_tensor(const int nband,
154152 }
155153#endif // __CUDA
156154
157- // ofs_running << " evolve_psi_tensor::start " << std::endl;
158-
159- ModuleBase::TITLE (" Evolve_psi" , " evolve_psi" );
160- time_t time_start = time (nullptr );
161- // ofs_running << " Start Time : " << ctime(&time_start);
162-
163155#ifdef __MPI
164-
165156 hamilt::MatrixBlock<std::complex <double >> h_mat, s_mat;
166157 p_hamilt->matrix (h_mat, s_mat);
167158
159+ ModuleBase::timer::tick (" TD_Efficiency" , " host_device_comm" );
160+
168161 // Create Tensor objects for temporary data and sync from host to device
169162 const int len_HS = use_lapack ? nlocal * nlocal : pv->nloc ;
170163 ct::Tensor Stmp (ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape ({len_HS}));
@@ -198,6 +191,8 @@ void evolve_psi_tensor(const int nband,
198191 syncmem_complex_h2d_op ()(Hold.data <std::complex <double >>(), h_mat.p , len_HS);
199192 }
200193
194+ ModuleBase::timer::tick (" TD_Efficiency" , " host_device_comm" );
195+
201196 ct::Tensor U_operator (ct::DataType::DT_COMPLEX_DOUBLE, ct_device_type, ct::TensorShape ({len_HS}));
202197 U_operator.zero ();
203198
@@ -298,14 +293,8 @@ void evolve_psi_tensor(const int nband,
298293 compute_ekb_tensor_lapack<Device>(pv, nband, nlocal, Hold, psi_k, ekb, ofs_running);
299294 }
300295 }
301-
302296#endif // __MPI
303297
304- time_t time_end = time (nullptr );
305- ModuleBase::GlobalFunc::OUT_TIME (" evolve(std::complex)" , time_start, time_end);
306-
307- // ofs_running << " evolve_psi_tensor::end " << std::endl;
308-
309298#if ((defined __CUDA) /* || (defined __ROCM) */ )
310299 if (ct_device_type == ct::DeviceType::GpuDevice)
311300 {
@@ -315,6 +304,9 @@ void evolve_psi_tensor(const int nband,
315304 }
316305#endif // __CUDA
317306
307+ time_t time_end = time (nullptr );
308+ ModuleBase::GlobalFunc::OUT_TIME (" evolve_psi" , time_start, time_end);
309+
318310 return ;
319311}
320312
0 commit comments