Skip to content

Commit

Permalink
Add timing output to report
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippRue committed May 31, 2024
1 parent 784aff9 commit 6fc9ed0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions aiida_kkr/workflows/kkr_STM.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ def impurity_cluster_evaluation(self):
used in self-consistency + the additional scanning sites.
"""
from aiida_kkr.tools import find_parent_structure
if _VERBOSE_:
from time import time

# measure time at start
t_start = time()

# Here we create an impurity cluster that has inside all the positions on which the STM will scan

Expand All @@ -352,15 +357,32 @@ def impurity_cluster_evaluation(self):
# now find all the positions we need to scan
coeff = self.get_scanning_positions(host_remote)

if _VERBOSE_:
# timing counters
t_imp_info, t_pot = 0., 0.

# construct impurity potential and imp_info for the impurity cluster + scanning area
for element in coeff:
if _VERBOSE_:
t0 = time()
tmp_imp_info = self.combine_potentials(host_structure, impurity_info, element[0], element[1])
impurity_info = tmp_imp_info

if _VERBOSE_:
t_imp_info += time() - t0
t0 = time()

# Aggregation the impurity nodes
tmp_imp_pot = self.combine_nodes(host_calc, imp_potential_node, element[0], element[1])
imp_potential_node = tmp_imp_pot

if _VERBOSE_:
t_pot += time() - t0

if _VERBOSE_:
# report elapsed time for cluster generation
self.report(f'time for cluster generation (s): {time()-t_start}, imp_info={t_imp_info}, pot={t_pot}')

return impurity_info, imp_potential_node

def get_scanning_positions(self, host_remote):
Expand Down

0 comments on commit 6fc9ed0

Please sign in to comment.