Skip to content

Commit bc1061c

Browse files
committed
Add timer
1 parent 5defffe commit bc1061c

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

source/source_lcao/module_operator_lcao/td_nonlocal_lcao.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ void hamilt::TDNonlocal<hamilt::OperatorLCAO<TK, TR>>::calculate_HR()
173173

174174
if (use_gpu)
175175
{
176+
ModuleBase::timer::tick("TD_Efficiency", "snap_psibeta_gpu_total");
176177
#ifdef __CUDA
177178
// GPU path: Atom-level GPU batch processing
178179
module_rt::gpu::snap_psibeta_atom_batch_gpu(orb_,
@@ -187,9 +188,11 @@ void hamilt::TDNonlocal<hamilt::OperatorLCAO<TK, TR>>::calculate_HR()
187188
nlm_dim,
188189
nlm_tot);
189190
#endif
191+
ModuleBase::timer::tick("TD_Efficiency", "snap_psibeta_gpu_total");
190192
}
191193
else
192194
{
195+
ModuleBase::timer::tick("TD_Efficiency", "snap_psibeta_cpu_total");
193196
// CPU path: OpenMP parallel over neighbors to compute nlm_tot
194197
#pragma omp parallel for schedule(dynamic)
195198
for (int ad = 0; ad < adjs.adj_num + 1; ++ad)
@@ -228,6 +231,7 @@ void hamilt::TDNonlocal<hamilt::OperatorLCAO<TK, TR>>::calculate_HR()
228231
}
229232
}
230233
}
234+
ModuleBase::timer::tick("TD_Efficiency", "snap_psibeta_cpu_total");
231235
}
232236

233237
// 2. calculate <psi_I|beta>D<beta|psi_{J,R}> for each pair of <IJR> atoms

source/source_lcao/module_rt/snap_psibeta_half_tddft.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ void snap_psibeta_half_tddft(const LCAO_Orbitals& orb,
110110
int required_size = calc_r ? 4 : 1;
111111
if (nlm.size() != required_size) nlm.resize(required_size);
112112

113-
if (nproj == 0) return;
113+
if (nproj == 0)
114+
{
115+
ModuleBase::timer::tick("module_rt", "snap_psibeta_half_tddft");
116+
return;
117+
}
114118

115119
// 2. Determine total number of projectors and identify active ones based on cutoff
116120
int natomwfc = 0;

0 commit comments

Comments
 (0)