From 108457701c783df62033fd4f5f0f034b32dbc89e Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 12 Jun 2018 17:01:20 -0500 Subject: [PATCH 1/7] [ci skip] Add @record_time decorators to the sumpy FMM. Depends on inducer/pytools!14. --- sumpy/fmm.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sumpy/fmm.py b/sumpy/fmm.py index ed2a1e4b..e9d4dd1d 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -34,7 +34,7 @@ from six.moves import zip import pyopencl as cl import pyopencl.array # noqa -from pytools import memoize_method +from pytools import memoize_method, record_time from sumpy import ( P2EFromSingleBox, P2EFromCSR, @@ -263,9 +263,11 @@ class SumpyExpansionWrangler(object): dtype=self.dtype) for k in self.code.out_kernels]) + @record_time("timing_data") def reorder_sources(self, source_array): return source_array.with_queue(self.queue)[self.tree.user_source_ids] + @record_time("timing_data") def reorder_potentials(self, potentials): from pytools.obj_array import is_obj_array, with_object_array_or_scalar assert is_obj_array(potentials) @@ -297,6 +299,7 @@ class SumpyExpansionWrangler(object): # }}} + @record_time("timing_data") def form_multipoles(self, level_start_source_box_nrs, source_boxes, src_weights): @@ -330,6 +333,7 @@ class SumpyExpansionWrangler(object): return mpoles + @record_time("timing_data") def coarsen_multipoles(self, level_start_source_parent_box_nrs, source_parent_boxes, @@ -385,6 +389,7 @@ class SumpyExpansionWrangler(object): return mpoles + @record_time("timing_data") def eval_direct(self, target_boxes, source_box_starts, source_box_lists, src_weights): pot = self.output_zeros() @@ -409,6 +414,7 @@ class SumpyExpansionWrangler(object): return pot + @record_time("timing_data") def multipole_to_local(self, level_start_target_box_nrs, target_boxes, src_box_starts, src_box_lists, @@ -448,6 +454,7 @@ class SumpyExpansionWrangler(object): return local_exps + @record_time("timing_data") def eval_multipoles(self, target_boxes_by_source_level, source_boxes_by_level, mpole_exps): pot = self.output_zeros() @@ -498,6 +505,7 @@ class SumpyExpansionWrangler(object): return pot + @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): @@ -536,6 +544,7 @@ class SumpyExpansionWrangler(object): return local_exps + @record_time("timing_data") def refine_locals(self, level_start_target_or_target_parent_box_nrs, target_or_target_parent_boxes, @@ -577,6 +586,7 @@ class SumpyExpansionWrangler(object): return local_exps + @record_time("timing_data") def eval_locals(self, level_start_target_box_nrs, target_boxes, local_exps): pot = self.output_zeros() @@ -612,6 +622,7 @@ class SumpyExpansionWrangler(object): return pot + @record_time("timing_data") def finalize_potentials(self, potentials): return potentials -- GitLab From 936ce6f388c508424cf01660c7a593502e33b3e0 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Thu, 21 Jun 2018 17:12:34 -0500 Subject: [PATCH 2/7] [ci skip] Implement timing data collection. --- sumpy/fmm.py | 131 +++++++++++++++++++++++++++++++++++++---------- test/test_fmm.py | 55 ++++++++++++++++++++ 2 files changed, 158 insertions(+), 28 deletions(-) diff --git a/sumpy/fmm.py b/sumpy/fmm.py index e9d4dd1d..2231bd7c 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -34,7 +34,7 @@ from six.moves import zip import pyopencl as cl import pyopencl.array # noqa -from pytools import memoize_method, record_time +from pytools import memoize_method from sumpy import ( P2EFromSingleBox, P2EFromCSR, @@ -145,8 +145,34 @@ class SumpyExpansionWranglerCodeContainer(object): # }}} +# {{{ timing future + +_SECONDS_PER_NANOSECOND = 1e-9 + + +class TimingFuture(object): + + def __init__(self, events): + self.events = events + + def __call__(self): + pyopencl.wait_for_events(self.events) + + result = 0 + for event in self.events: + result += event.profile.end - event.profile.start + + return result * _SECONDS_PER_NANOSECOND + +# }}} + + # {{{ expansion wrangler +class UnableToCollectTimingData(UserWarning): + pass + + class SumpyExpansionWrangler(object): """Implements the :class:`boxtree.fmm.ExpansionWranglerInterface` by using :mod:`sumpy` expansions/translations. @@ -175,6 +201,7 @@ class SumpyExpansionWrangler(object): self.code = code_container self.queue = queue self.tree = tree + self.issued_timing_data_warning = False self.dtype = dtype @@ -263,11 +290,9 @@ class SumpyExpansionWrangler(object): dtype=self.dtype) for k in self.code.out_kernels]) - @record_time("timing_data") def reorder_sources(self, source_array): return source_array.with_queue(self.queue)[self.tree.user_source_ids] - @record_time("timing_data") def reorder_potentials(self, potentials): from pytools.obj_array import is_obj_array, with_object_array_or_scalar assert is_obj_array(potentials) @@ -299,15 +324,35 @@ class SumpyExpansionWrangler(object): # }}} - @record_time("timing_data") + def _update_timing_data(self, description, timing_data, events): + if timing_data is None: + return + + if not self.queue.properties & cl.command_queue_properties.PROFILING_ENABLE: + if not self.issued_timing_data_warning: + from warnings import warn + warn( + "Profiling was not enabled in the command queue. " + "Timing data will not be collected.", + category=UnableToCollectTimingData, + stacklevel=3) + + self.issued_timing_data_warning = True + return + + timing_data["description"] = description + timing_data["callback"] = TimingFuture(events) + def form_multipoles(self, level_start_source_box_nrs, source_boxes, - src_weights): + src_weights, timing_data=None): mpoles = self.multipole_expansion_zeros() kwargs = self.extra_kwargs.copy() kwargs.update(self.box_source_list_kwargs()) + events = [] + for lev in range(self.tree.nlevels): p2m = self.code.p2m(self.level_orders[lev]) start, stop = level_start_source_box_nrs[lev:lev+2] @@ -328,19 +373,21 @@ class SumpyExpansionWrangler(object): rscale=level_to_rscale(self.tree, lev), **kwargs) + events.append(evt) assert mpoles_res is mpoles_view + self._update_timing_data("form_multipoles", timing_data, events) + return mpoles - @record_time("timing_data") def coarsen_multipoles(self, level_start_source_parent_box_nrs, source_parent_boxes, - mpoles): + mpoles, timing_data=None): tree = self.tree - evt = None + events = [] # nlevels-1 is the last valid level index # nlevels-2 is the last valid level that could have children @@ -382,16 +429,19 @@ class SumpyExpansionWrangler(object): tgt_rscale=level_to_rscale(self.tree, target_level), **self.kernel_extra_kwargs) + events.append(evt) + assert mpoles_res is target_mpoles_view - if evt is not None: - mpoles.add_event(evt) + if events: + mpoles.add_event(events[-1]) + + self._update_timing_data("coarsen_multipoles", timing_data, events) return mpoles - @record_time("timing_data") def eval_direct(self, target_boxes, source_box_starts, - source_box_lists, src_weights): + source_box_lists, src_weights, timing_data=None): pot = self.output_zeros() kwargs = self.extra_kwargs.copy() @@ -399,6 +449,8 @@ class SumpyExpansionWrangler(object): kwargs.update(self.box_source_list_kwargs()) kwargs.update(self.box_target_list_kwargs()) + events = [] + evt, pot_res = self.code.p2p()(self.queue, target_boxes=target_boxes, source_box_starts=source_box_starts, @@ -407,20 +459,24 @@ class SumpyExpansionWrangler(object): result=pot, **kwargs) + events.append(evt) for pot_i, pot_res_i in zip(pot, pot_res): assert pot_i is pot_res_i pot_i.add_event(evt) + self._update_timing_data("eval_direct", timing_data, events) + return pot - @record_time("timing_data") def multipole_to_local(self, level_start_target_box_nrs, target_boxes, src_box_starts, src_box_lists, - mpole_exps): + mpole_exps, timing_data=None): local_exps = self.local_expansion_zeros() + events = [] + for lev in range(self.tree.nlevels): start, stop = level_start_target_box_nrs[lev:lev+2] if start == stop: @@ -451,20 +507,24 @@ class SumpyExpansionWrangler(object): tgt_rscale=level_to_rscale(self.tree, lev), **self.kernel_extra_kwargs) + events.append(evt) + + self._update_timing_data("eval_direct", timing_data, events) return local_exps - @record_time("timing_data") def eval_multipoles(self, - target_boxes_by_source_level, source_boxes_by_level, mpole_exps): + target_boxes_by_source_level, source_boxes_by_level, mpole_exps, + timing_data=None): pot = self.output_zeros() kwargs = self.kernel_extra_kwargs.copy() kwargs.update(self.box_target_list_kwargs()) + events = [] + wait_for = mpole_exps.events - has_evt = False for isrc_level, ssn in enumerate(source_boxes_by_level): if len(target_boxes_by_source_level[isrc_level]) == 0: continue @@ -491,29 +551,32 @@ class SumpyExpansionWrangler(object): wait_for=wait_for, **kwargs) + events.append(evt) - has_evt = True wait_for = [evt] for pot_i, pot_res_i in zip(pot, pot_res): assert pot_i is pot_res_i - if has_evt: + if events: for pot_i in pot: - # Intentionally only adding the last event. - pot_i.add_event(evt) + pot_i.add_event(events[-1]) + + self._update_timing_data("eval_multipoles", timing_data, events) return pot - @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): + target_or_target_parent_boxes, starts, lists, src_weights, + timing_data=None): local_exps = self.local_expansion_zeros() kwargs = self.extra_kwargs.copy() kwargs.update(self.box_source_list_kwargs()) + events = [] + for lev in range(self.tree.nlevels): start, stop = \ level_start_target_or_target_parent_box_nrs[lev:lev+2] @@ -539,16 +602,21 @@ class SumpyExpansionWrangler(object): rscale=level_to_rscale(self.tree, lev), **kwargs) + events.append(evt) assert result is target_local_exps_view + self._update_timing_data("form_locals", timing_data, events) + return local_exps - @record_time("timing_data") def refine_locals(self, level_start_target_or_target_parent_box_nrs, target_or_target_parent_boxes, - local_exps): + local_exps, timing_data=None): + + events = [] + for target_lev in range(1, self.tree.nlevels): start, stop = level_start_target_or_target_parent_box_nrs[ target_lev:target_lev+2] @@ -579,20 +647,25 @@ class SumpyExpansionWrangler(object): tgt_rscale=level_to_rscale(self.tree, target_lev), **self.kernel_extra_kwargs) + events.append(evt) assert local_exps_res is target_local_exps_view local_exps.add_event(evt) + self._update_timing_data("refine_locals", timing_data, events) + return local_exps - @record_time("timing_data") - def eval_locals(self, level_start_target_box_nrs, target_boxes, local_exps): + def eval_locals(self, level_start_target_box_nrs, target_boxes, local_exps, + timing_data=None): pot = self.output_zeros() kwargs = self.kernel_extra_kwargs.copy() kwargs.update(self.box_target_list_kwargs()) + events = [] + for lev in range(self.tree.nlevels): start, stop = level_start_target_box_nrs[lev:lev+2] if start == stop: @@ -616,13 +689,15 @@ class SumpyExpansionWrangler(object): rscale=level_to_rscale(self.tree, lev), **kwargs) + events.append(evt) for pot_i, pot_res_i in zip(pot, pot_res): assert pot_i is pot_res_i + self._update_timing_data("eval_locals", timing_data, events) + return pot - @record_time("timing_data") def finalize_potentials(self, potentials): return potentials diff --git a/test/test_fmm.py b/test/test_fmm.py index 0331db6c..5ec3498c 100644 --- a/test/test_fmm.py +++ b/test/test_fmm.py @@ -234,6 +234,61 @@ def test_sumpy_fmm(ctx_getter, knl, local_expn_class, mpole_expn_class): pconv_verifier() +def test_sumpy_fmm_timing_data(ctx_getter): + logging.basicConfig(level=logging.INFO) + + ctx = ctx_getter() + queue = cl.CommandQueue( + ctx, + properties=cl.command_queue_properties.PROFILING_ENABLE) + + nsources = 500 + dtype = np.float64 + + from boxtree.tools import ( + make_normal_particle_array as p_normal) + + knl = LaplaceKernel(2) + local_expn_class = VolumeTaylorLocalExpansion + mpole_expn_class = VolumeTaylorMultipoleExpansion + order = 1 + + sources = p_normal(queue, nsources, knl.dim, dtype, seed=15) + + from boxtree import TreeBuilder + tb = TreeBuilder(ctx) + + tree, _ = tb(queue, sources, + max_particles_in_box=30, debug=True) + + from boxtree.traversal import FMMTraversalBuilder + tbuild = FMMTraversalBuilder(ctx) + trav, _ = tbuild(queue, tree, debug=True) + + from pyopencl.clrandom import PhiloxGenerator + rng = PhiloxGenerator(ctx) + weights = rng.uniform(queue, nsources, dtype=np.float64) + + out_kernels = [knl] + + from functools import partial + + from sumpy.fmm import SumpyExpansionWranglerCodeContainer + wcc = SumpyExpansionWranglerCodeContainer( + ctx, + partial(mpole_expn_class, knl), + partial(local_expn_class, knl), + out_kernels) + + wrangler = wcc.get_wrangler(queue, tree, dtype, + fmm_level_to_order=lambda kernel, kernel_args, tree, lev: order) + from boxtree.fmm import drive_fmm + + timing_data = {} + pot, = drive_fmm(trav, wrangler, weights, timing_data=timing_data) + assert timing_data + + def test_sumpy_fmm_exclude_self(ctx_getter): logging.basicConfig(level=logging.INFO) -- GitLab From cd467c415befc6bad4edcbe0cc4ac02309cbff35 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Fri, 6 Jul 2018 17:46:18 -0500 Subject: [PATCH 3/7] Update for boxtree changes. --- requirements.txt | 2 +- setup.py | 2 +- sumpy/fmm.py | 16 +++++++++++----- test/test_fmm.py | 1 + 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1e86e610..0acdd382 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,6 @@ sympy==1.0 git+https://github.com/inducer/pymbolic git+https://github.com/inducer/islpy git+https://github.com/inducer/pyopencl -git+https://gitlab.tiker.net/inducer/boxtree +git+https://gitlab.tiker.net/inducer/boxtree@timing-data git+https://github.com/inducer/loopy git+https://github.com/inducer/pyfmmlib diff --git a/setup.py b/setup.py index 8d085054..9457bbdc 100644 --- a/setup.py +++ b/setup.py @@ -94,7 +94,7 @@ setup(name="sumpy", install_requires=[ "pytools>=2018.2", "loo.py>=2017.2", - "boxtree>=2013.1", + "boxtree>=2018.1", "pytest>=2.3", "six", diff --git a/sumpy/fmm.py b/sumpy/fmm.py index 2231bd7c..52748c7d 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -155,14 +155,20 @@ class TimingFuture(object): def __init__(self, events): self.events = events - def __call__(self): + @memoize_method + def get(self): pyopencl.wait_for_events(self.events) result = 0 for event in self.events: - result += event.profile.end - event.profile.start + result += ( + (event.profile.end - event.profile.start) + * _SECONDS_PER_NANOSECOND) + return result - return result * _SECONDS_PER_NANOSECOND + def __call__(self): + from boxtree.fmm import TimingResult + return TimingResult(wall_elapsed=self.get(), process_elapsed=None) # }}} @@ -340,8 +346,8 @@ class SumpyExpansionWrangler(object): self.issued_timing_data_warning = True return - timing_data["description"] = description - timing_data["callback"] = TimingFuture(events) + timing_data.description = description + timing_data.callback = TimingFuture(events) def form_multipoles(self, level_start_source_box_nrs, source_boxes, diff --git a/test/test_fmm.py b/test/test_fmm.py index 5ec3498c..0c4406bf 100644 --- a/test/test_fmm.py +++ b/test/test_fmm.py @@ -286,6 +286,7 @@ def test_sumpy_fmm_timing_data(ctx_getter): timing_data = {} pot, = drive_fmm(trav, wrangler, weights, timing_data=timing_data) + print(timing_data) assert timing_data -- GitLab From faa80af925f30d600be343b2616e1f1e9f6d2568 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Fri, 6 Jul 2018 18:08:22 -0500 Subject: [PATCH 4/7] Rename _update_timing_data to update_timing_data, as subclasses are expected to use it --- sumpy/fmm.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sumpy/fmm.py b/sumpy/fmm.py index 52748c7d..cd3ed0af 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -330,7 +330,7 @@ class SumpyExpansionWrangler(object): # }}} - def _update_timing_data(self, description, timing_data, events): + def update_timing_data(self, description, timing_data, events): if timing_data is None: return @@ -383,7 +383,7 @@ class SumpyExpansionWrangler(object): assert mpoles_res is mpoles_view - self._update_timing_data("form_multipoles", timing_data, events) + self.update_timing_data("form_multipoles", timing_data, events) return mpoles @@ -442,7 +442,7 @@ class SumpyExpansionWrangler(object): if events: mpoles.add_event(events[-1]) - self._update_timing_data("coarsen_multipoles", timing_data, events) + self.update_timing_data("coarsen_multipoles", timing_data, events) return mpoles @@ -471,7 +471,7 @@ class SumpyExpansionWrangler(object): assert pot_i is pot_res_i pot_i.add_event(evt) - self._update_timing_data("eval_direct", timing_data, events) + self.update_timing_data("eval_direct", timing_data, events) return pot @@ -515,7 +515,7 @@ class SumpyExpansionWrangler(object): **self.kernel_extra_kwargs) events.append(evt) - self._update_timing_data("eval_direct", timing_data, events) + self.update_timing_data("eval_direct", timing_data, events) return local_exps @@ -568,7 +568,7 @@ class SumpyExpansionWrangler(object): for pot_i in pot: pot_i.add_event(events[-1]) - self._update_timing_data("eval_multipoles", timing_data, events) + self.update_timing_data("eval_multipoles", timing_data, events) return pot @@ -612,7 +612,7 @@ class SumpyExpansionWrangler(object): assert result is target_local_exps_view - self._update_timing_data("form_locals", timing_data, events) + self.update_timing_data("form_locals", timing_data, events) return local_exps @@ -659,7 +659,7 @@ class SumpyExpansionWrangler(object): local_exps.add_event(evt) - self._update_timing_data("refine_locals", timing_data, events) + self.update_timing_data("refine_locals", timing_data, events) return local_exps @@ -700,7 +700,7 @@ class SumpyExpansionWrangler(object): for pot_i, pot_res_i in zip(pot, pot_res): assert pot_i is pot_res_i - self._update_timing_data("eval_locals", timing_data, events) + self.update_timing_data("eval_locals", timing_data, events) return pot -- GitLab From 00d96cb4f4d79c6515247100071503dd8e40f140 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Fri, 6 Jul 2018 18:13:09 -0500 Subject: [PATCH 5/7] Fix conda requirements.txt to point to timing-data branch of boxtree --- .test-conda-env-py3-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.test-conda-env-py3-requirements.txt b/.test-conda-env-py3-requirements.txt index 45c20c1f..8c9f55d9 100644 --- a/.test-conda-env-py3-requirements.txt +++ b/.test-conda-env-py3-requirements.txt @@ -1,3 +1,3 @@ -git+https://gitlab.tiker.net/inducer/boxtree +git+https://gitlab.tiker.net/inducer/boxtree@timing-data git+https://github.com/inducer/pymbolic git+https://github.com/inducer/loopy -- GitLab From d18375016671751d039bf3a8ecd37504193e4fd7 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 9 Jul 2018 23:02:48 -0500 Subject: [PATCH 6/7] Update for boxtree changes --- sumpy/fmm.py | 107 +++++++++++++++++++---------------------------- test/test_fmm.py | 2 +- 2 files changed, 43 insertions(+), 66 deletions(-) diff --git a/sumpy/fmm.py b/sumpy/fmm.py index cd3ed0af..17d52eed 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -150,13 +150,29 @@ class SumpyExpansionWranglerCodeContainer(object): _SECONDS_PER_NANOSECOND = 1e-9 -class TimingFuture(object): +class UnableToCollectTimingData(UserWarning): + pass + + +class SumpyTimingFuture(object): - def __init__(self, events): + def __init__(self, queue, events): + self.queue = queue self.events = events @memoize_method - def get(self): + def result(self): + from boxtree.fmm import TimingResult + + if not self.queue.properties & cl.command_queue_properties.PROFILING_ENABLE: + from warnings import warn + warn( + "Profiling was not enabled in the command queue. " + "Timing data will not be collected.", + category=UnableToCollectTimingData, + stacklevel=3) + return TimingResult(wall_elapsed=None, process_elapsed=None) + pyopencl.wait_for_events(self.events) result = 0 @@ -164,21 +180,20 @@ class TimingFuture(object): result += ( (event.profile.end - event.profile.start) * _SECONDS_PER_NANOSECOND) - return result - def __call__(self): - from boxtree.fmm import TimingResult - return TimingResult(wall_elapsed=self.get(), process_elapsed=None) + return TimingResult(wall_elapsed=result, process_elapsed=None) + + def done(self): + return all( + event.get_info(cl.event_info.COMMAND_EXECUTION_STATUS) + == cl.command_execution_status.COMPLETE + for event in self.events) # }}} # {{{ expansion wrangler -class UnableToCollectTimingData(UserWarning): - pass - - class SumpyExpansionWrangler(object): """Implements the :class:`boxtree.fmm.ExpansionWranglerInterface` by using :mod:`sumpy` expansions/translations. @@ -330,28 +345,9 @@ class SumpyExpansionWrangler(object): # }}} - def update_timing_data(self, description, timing_data, events): - if timing_data is None: - return - - if not self.queue.properties & cl.command_queue_properties.PROFILING_ENABLE: - if not self.issued_timing_data_warning: - from warnings import warn - warn( - "Profiling was not enabled in the command queue. " - "Timing data will not be collected.", - category=UnableToCollectTimingData, - stacklevel=3) - - self.issued_timing_data_warning = True - return - - timing_data.description = description - timing_data.callback = TimingFuture(events) - def form_multipoles(self, level_start_source_box_nrs, source_boxes, - src_weights, timing_data=None): + src_weights): mpoles = self.multipole_expansion_zeros() kwargs = self.extra_kwargs.copy() @@ -383,14 +379,12 @@ class SumpyExpansionWrangler(object): assert mpoles_res is mpoles_view - self.update_timing_data("form_multipoles", timing_data, events) - - return mpoles + return (mpoles, SumpyTimingFuture(self.queue, events)) def coarsen_multipoles(self, level_start_source_parent_box_nrs, source_parent_boxes, - mpoles, timing_data=None): + mpoles): tree = self.tree events = [] @@ -442,12 +436,10 @@ class SumpyExpansionWrangler(object): if events: mpoles.add_event(events[-1]) - self.update_timing_data("coarsen_multipoles", timing_data, events) - - return mpoles + return (mpoles, SumpyTimingFuture(self.queue, events)) def eval_direct(self, target_boxes, source_box_starts, - source_box_lists, src_weights, timing_data=None): + source_box_lists, src_weights): pot = self.output_zeros() kwargs = self.extra_kwargs.copy() @@ -471,14 +463,12 @@ class SumpyExpansionWrangler(object): assert pot_i is pot_res_i pot_i.add_event(evt) - self.update_timing_data("eval_direct", timing_data, events) - - return pot + return (pot, SumpyTimingFuture(self.queue, events)) def multipole_to_local(self, level_start_target_box_nrs, target_boxes, src_box_starts, src_box_lists, - mpole_exps, timing_data=None): + mpole_exps): local_exps = self.local_expansion_zeros() events = [] @@ -515,13 +505,10 @@ class SumpyExpansionWrangler(object): **self.kernel_extra_kwargs) events.append(evt) - self.update_timing_data("eval_direct", timing_data, events) - - return local_exps + return (local_exps, SumpyTimingFuture(self.queue, events)) def eval_multipoles(self, - target_boxes_by_source_level, source_boxes_by_level, mpole_exps, - timing_data=None): + target_boxes_by_source_level, source_boxes_by_level, mpole_exps): pot = self.output_zeros() kwargs = self.kernel_extra_kwargs.copy() @@ -568,14 +555,11 @@ class SumpyExpansionWrangler(object): for pot_i in pot: pot_i.add_event(events[-1]) - self.update_timing_data("eval_multipoles", timing_data, events) - - return pot + return (pot, SumpyTimingFuture(self.queue, events)) def form_locals(self, level_start_target_or_target_parent_box_nrs, - target_or_target_parent_boxes, starts, lists, src_weights, - timing_data=None): + target_or_target_parent_boxes, starts, lists, src_weights): local_exps = self.local_expansion_zeros() kwargs = self.extra_kwargs.copy() @@ -612,14 +596,12 @@ class SumpyExpansionWrangler(object): assert result is target_local_exps_view - self.update_timing_data("form_locals", timing_data, events) - - return local_exps + return (local_exps, SumpyTimingFuture(self.queue, events)) def refine_locals(self, level_start_target_or_target_parent_box_nrs, target_or_target_parent_boxes, - local_exps, timing_data=None): + local_exps): events = [] @@ -659,12 +641,9 @@ class SumpyExpansionWrangler(object): local_exps.add_event(evt) - self.update_timing_data("refine_locals", timing_data, events) - - return local_exps + return (local_exps, SumpyTimingFuture(self.queue, [evt])) - def eval_locals(self, level_start_target_box_nrs, target_boxes, local_exps, - timing_data=None): + def eval_locals(self, level_start_target_box_nrs, target_boxes, local_exps): pot = self.output_zeros() kwargs = self.kernel_extra_kwargs.copy() @@ -700,9 +679,7 @@ class SumpyExpansionWrangler(object): for pot_i, pot_res_i in zip(pot, pot_res): assert pot_i is pot_res_i - self.update_timing_data("eval_locals", timing_data, events) - - return pot + return (pot, SumpyTimingFuture(self.queue, events)) def finalize_potentials(self, potentials): return potentials diff --git a/test/test_fmm.py b/test/test_fmm.py index 0c4406bf..71e3f044 100644 --- a/test/test_fmm.py +++ b/test/test_fmm.py @@ -234,7 +234,7 @@ def test_sumpy_fmm(ctx_getter, knl, local_expn_class, mpole_expn_class): pconv_verifier() -def test_sumpy_fmm_timing_data(ctx_getter): +def test_sumpy_fmm_timing_data_collection(ctx_getter): logging.basicConfig(level=logging.INFO) ctx = ctx_getter() -- GitLab From 54cef6b672d99639a4c0c5a9f26f73c04949ceab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Wed, 11 Jul 2018 15:43:05 -0400 Subject: [PATCH 7/7] Point requirements.txt back at boxtree master --- .test-conda-env-py3-requirements.txt | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.test-conda-env-py3-requirements.txt b/.test-conda-env-py3-requirements.txt index 8c9f55d9..45c20c1f 100644 --- a/.test-conda-env-py3-requirements.txt +++ b/.test-conda-env-py3-requirements.txt @@ -1,3 +1,3 @@ -git+https://gitlab.tiker.net/inducer/boxtree@timing-data +git+https://gitlab.tiker.net/inducer/boxtree git+https://github.com/inducer/pymbolic git+https://github.com/inducer/loopy diff --git a/requirements.txt b/requirements.txt index 3a159527..8e48bc1c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,6 @@ sympy==1.1.1 git+https://github.com/inducer/pymbolic git+https://github.com/inducer/islpy git+https://github.com/inducer/pyopencl -git+https://gitlab.tiker.net/inducer/boxtree@timing-data +git+https://gitlab.tiker.net/inducer/boxtree git+https://github.com/inducer/loopy git+https://github.com/inducer/pyfmmlib -- GitLab