From 02073109ceb9fb6178822a47ea3b06c967ee0197 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 12 Jun 2018 17:00:01 -0500 Subject: [PATCH] [ci skip] Add @record_time decorators to the pyfmmlib FMM. Depends on inducer/pytools!14. --- boxtree/pyfmmlib_integration.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/boxtree/pyfmmlib_integration.py b/boxtree/pyfmmlib_integration.py index ddf7e20..f6143f5 100644 --- a/boxtree/pyfmmlib_integration.py +++ b/boxtree/pyfmmlib_integration.py @@ -26,7 +26,7 @@ THE SOFTWARE. import numpy as np -from pytools import memoize_method, log_process +from pytools import memoize_method, log_process, record_time import logging logger = logging.getLogger(__name__) @@ -394,10 +394,12 @@ class FMMLibExpansionWrangler(object): # }}} @log_process(logger) + @record_time("timing_data") def reorder_sources(self, source_array): return source_array[..., self.tree.user_source_ids] @log_process(logger) + @record_time("timing_data") def reorder_potentials(self, potentials): return potentials[self.tree.sorted_target_ids] @@ -420,6 +422,7 @@ class FMMLibExpansionWrangler(object): } @log_process(logger) + @record_time("timing_data") def form_multipoles(self, level_start_source_box_nrs, source_boxes, src_weights): formmp = self.get_routine("%ddformmp" + self.dp_suffix) @@ -459,6 +462,7 @@ class FMMLibExpansionWrangler(object): return mpoles @log_process(logger) + @record_time("timing_data") def coarsen_multipoles(self, level_start_source_parent_box_nrs, source_parent_boxes, mpoles): tree = self.tree @@ -512,6 +516,7 @@ class FMMLibExpansionWrangler(object): ibox - target_level_start_ibox] += new_mp[..., 0].T @log_process(logger) + @record_time("timing_data") def eval_direct(self, target_boxes, neighbor_sources_starts, neighbor_sources_lists, src_weights): output = self.output_zeros() @@ -553,6 +558,7 @@ class FMMLibExpansionWrangler(object): return output @log_process(logger) + @record_time("timing_data") def multipole_to_local(self, level_start_target_or_target_parent_box_nrs, target_or_target_parent_boxes, @@ -638,6 +644,7 @@ class FMMLibExpansionWrangler(object): return local_exps @log_process(logger) + @record_time("timing_data") def eval_multipoles(self, target_boxes_by_source_level, sep_smaller_nonsiblings_by_level, mpole_exps): @@ -680,6 +687,7 @@ class FMMLibExpansionWrangler(object): return output @log_process(logger) + @record_time("timing_data") def form_locals(self, level_start_target_or_target_parent_box_nrs, target_or_target_parent_boxes, starts, lists, src_weights): @@ -731,6 +739,7 @@ class FMMLibExpansionWrangler(object): return local_exps @log_process(logger) + @record_time("timing_data") def refine_locals(self, level_start_target_or_target_parent_box_nrs, target_or_target_parent_boxes, local_exps): @@ -777,6 +786,7 @@ class FMMLibExpansionWrangler(object): return local_exps @log_process(logger) + @record_time("timing_data") def eval_locals(self, level_start_target_box_nrs, target_boxes, local_exps): output = self.output_zeros() taeval = self.get_expn_eval_routine("ta") @@ -812,6 +822,7 @@ class FMMLibExpansionWrangler(object): return output @log_process(logger) + @record_time("timing_data") def finalize_potentials(self, potential): if self.eqn_letter == "l" and self.dim == 2: scale_factor = -1/(2*np.pi) -- GitLab