From 1e8c99382c4727975feb0f59b2eea2d02dba3a15 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Thu, 2 May 2019 13:32:29 -0500 Subject: [PATCH 1/4] CodeBuilder: Rename fence() to reset_dep_tracking() See dagrt!27 --- examples/implicit_euler/implicit_euler.py | 2 +- leap/__init__.py | 4 ++-- leap/multistep/__init__.py | 10 +++++----- leap/multistep/multirate/__init__.py | 22 +++++++++++----------- leap/rk/__init__.py | 14 +++++++------- leap/rk/imex.py | 2 +- setup.py | 2 +- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/examples/implicit_euler/implicit_euler.py b/examples/implicit_euler/implicit_euler.py index d99e01b..b2f2d5e 100644 --- a/examples/implicit_euler/implicit_euler.py +++ b/examples/implicit_euler/implicit_euler.py @@ -80,5 +80,5 @@ class ImplicitEulerMethod(Method): builder.yield_state(self.state, self.component_id, self.t + self.dt, 'final') - builder.fence() + builder.reset_dep_tracking() builder.assign(self.t, self.t + self.dt) diff --git a/leap/__init__.py b/leap/__init__.py index cc43469..ec749a5 100644 --- a/leap/__init__.py +++ b/leap/__init__.py @@ -141,13 +141,13 @@ class TwoOrderAdaptiveMethod(Method): cb.raise_(TimeStepUnderflow) with cb.else_(): cb.fail_step() - cb.fence() + cb.reset_dep_tracking() with cb.else_(): # This updates :
should not be set before this is called. self.finish_nonadaptive(cb, high_order_estimate, low_order_estimate) - cb.fence() + cb.reset_dep_tracking() cb(self.dt, Min((0.9 * self.dt * rel_error ** (-1 / self.high_order), self.max_dt_growth * self.dt))) diff --git a/leap/multistep/__init__.py b/leap/multistep/__init__.py index 2187c46..ff1fe06 100644 --- a/leap/multistep/__init__.py +++ b/leap/multistep/__init__.py @@ -135,7 +135,7 @@ def _emit_func_family_operation(cb, name_gen, for j in range(len(function_family)*len(function_family)): cb(sig_array[j], 0) - cb.fence() + cb.reset_dep_tracking() for i in range(len(function_family)): cb(sig_array[i*(nfunctions+1)], sigma[i]**-1) @@ -297,7 +297,7 @@ class AdamsBashforthMethod(Method): t_end = 1 cb_primary(rhs_var, self.eval_rhs(self.t, self.state)) - cb_primary.fence() + cb_primary.reset_dep_tracking() history = self.history + [rhs_var] ab_sum = emit_ab_integration( @@ -313,13 +313,13 @@ class AdamsBashforthMethod(Method): # Rotate history and time history. for i in range(self.hist_length - 1): - cb_primary.fence() + cb_primary.reset_dep_tracking() cb_primary(self.history[i], history[i + 1]) if not self.static_dt: cb_primary(self.time_history[i], time_history_data[i + 1]) - cb_primary.fence() + cb_primary.reset_dep_tracking() cb_primary(self.t, self.t + self.dt) cb_primary.yield_state(expression=self.state, component_id=self.component_id, @@ -400,7 +400,7 @@ class AdamsBashforthMethod(Method): # Merge the values of the RHSs. rk_comb = sum(coeff * rhss[j] for j, coeff in enumerate(rk_coeffs)) - cb.fence() + cb.reset_dep_tracking() state_est = self.state + self.dt * rk_comb if self.state_filter is not None: diff --git a/leap/multistep/multirate/__init__.py b/leap/multistep/multirate/__init__.py index 79f5593..6792ecc 100644 --- a/leap/multistep/multirate/__init__.py +++ b/leap/multistep/multirate/__init__.py @@ -539,7 +539,7 @@ class MultiRateMultiStepMethod(Method): # }}} - cb.fence() + cb.reset_dep_tracking() component_state_ests = {} @@ -576,7 +576,7 @@ class MultiRateMultiStepMethod(Method): component_state_ests[comp_name] = state_var - cb.fence() + cb.reset_dep_tracking() for component_name in self.component_names: state = component_state_ests[component_name] @@ -588,7 +588,7 @@ class MultiRateMultiStepMethod(Method): cb(var(""+component_name), state) - cb.fence() + cb.reset_dep_tracking() cb(self.t, self.t + self.dt/self.nsubsteps) @@ -712,18 +712,18 @@ class MultiRateMultiStepMethod(Method): # }}} - cb.fence() + cb.reset_dep_tracking() if isubstep == 0: with cb.if_(self.bootstrap_step, "==", bootstrap_steps): cb.switch_phase("primary") cb.restart_step() - cb.fence() + cb.reset_dep_tracking() self.emit_small_rk_step(cb, name_prefix, name_gen, current_rhss) - cb.fence() + cb.reset_dep_tracking() cb(self.bootstrap_step, self.bootstrap_step + 1) return cb @@ -1081,7 +1081,7 @@ class MultiRateMultiStepMethod(Method): # }}} - cb.fence() + cb.reset_dep_tracking() log_hist_state() @@ -1089,7 +1089,7 @@ class MultiRateMultiStepMethod(Method): get_state(component_name, self.nsubsteps) for component_name in self.component_names] - cb.fence() + cb.reset_dep_tracking() # {{{ commit temp history to permanent history @@ -1104,13 +1104,13 @@ class MultiRateMultiStepMethod(Method): temp_time_vars[comp_name, irhs][-rhs.history_length:]): cb(time_var, time_expr) - cb.fence() + cb.reset_dep_tracking() for hist_var, hist_expr in zip( self.history_vars[key], temp_hist_vars[comp_name, irhs][-rhs.history_length:]): cb(hist_var, hist_expr) - cb.fence() + cb.reset_dep_tracking() commit_temp_hist_vars() @@ -1125,7 +1125,7 @@ class MultiRateMultiStepMethod(Method): cb(var(""+component_name), state) - cb.fence() + cb.reset_dep_tracking() cb(self.t, self.t + self.dt) diff --git a/leap/rk/__init__.py b/leap/rk/__init__.py index e019ca0..c64264b 100644 --- a/leap/rk/__init__.py +++ b/leap/rk/__init__.py @@ -320,7 +320,7 @@ class ButcherTableauMethod(Method): estimate_vars[iest], state_est) - cb.fence() + cb.reset_dep_tracking() # This updates . self.finish(cb, estimate_coeff_set_names, estimate_vars) @@ -334,7 +334,7 @@ class ButcherTableauMethod(Method): self.c, stage_coeff_sets[name])): cb(last_rhss[name], stage_rhs_vars[name][-1]) - cb.fence() + cb.reset_dep_tracking() cb_primary = cb @@ -350,7 +350,7 @@ class ButcherTableauMethod(Method): def finish(self, cb, estimate_names, estimate_vars): cb(self.state, estimate_vars[0]) cb.yield_state(self.state, self.component_id, self.t + self.dt, 'final') - cb.fence() + cb.reset_dep_tracking() cb(self.t, self.t + self.dt) # }}} @@ -587,7 +587,7 @@ class EmbeddedButcherTableauMethod(ButcherTableauMethod, TwoOrderAdaptiveMethod) cb(self.state, est) cb.yield_state(self.state, self.component_id, self.t + self.dt, 'final') - cb.fence() + cb.reset_dep_tracking() cb(self.t, self.t + self.dt) # }}} @@ -751,7 +751,7 @@ class LSRK4Method(Method): with CodeBuilder("primary") as cb: for a, b, c in self.coeffs: - cb.fence() + cb.reset_dep_tracking() cb(rhs_val, rhs_func(t=t + c*dt, **{comp_id: state})) cb(residual, a*residual + dt*rhs_val) new_state_expr = state + b * residual @@ -759,11 +759,11 @@ class LSRK4Method(Method): if self.state_filter is not None: new_state_expr = self.state_filter(**{comp_id: new_state_expr}) - cb.fence() + cb.reset_dep_tracking() cb(state, new_state_expr) cb.yield_state(state, comp_id, t + dt, 'final') - cb.fence() + cb.reset_dep_tracking() cb(t, t + dt) cb_primary = cb diff --git a/leap/rk/imex.py b/leap/rk/imex.py index bc60a67..5df7e3d 100644 --- a/leap/rk/imex.py +++ b/leap/rk/imex.py @@ -140,7 +140,7 @@ class KennedyCarpenterIMEXRungeKuttaMethodBase( cb(self.state, est) cb.yield_state(self.state, self.component_id, self.t + self.dt, 'final') - cb.fence() + cb.reset_dep_tracking() cb(self.t, self.t + self.dt) diff --git a/setup.py b/setup.py index bff99cd..db14a32 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ def main(): "pytools>=2014.1", "pymbolic>=2014.1", "pytest>=2.3", - "dagrt>=2019.1", + "dagrt>=2019.2", "mako", "six", ], -- GitLab From fca15453de6b9b97b5fd7b7ecf36a44e66c2f180 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Thu, 2 May 2019 13:34:00 -0500 Subject: [PATCH 2/4] Point requirements.txt to dagrt fence-rename branch --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e22f333..d13c137 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ git+git://github.com/inducer/pytools git+git://github.com/inducer/pymbolic -git+https://gitlab.tiker.net/inducer/dagrt.git \ No newline at end of file +git+https://gitlab.tiker.net/inducer/dagrt.git@fence-rename -- GitLab From 0a83cb595e194091c190bfc9cfaa13366961d109 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Thu, 2 May 2019 13:36:56 -0500 Subject: [PATCH 3/4] Bump version --- leap/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leap/version.py b/leap/version.py index 78a7f0b..b8345dc 100644 --- a/leap/version.py +++ b/leap/version.py @@ -1,2 +1,2 @@ -VERSION = (2019, 1) +VERSION = (2019, 2) VERSION_TEXT = ".".join(str(i) for i in VERSION) -- GitLab From 7842063ba0d8d4974a4e42768660965757583b1a Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Thu, 2 May 2019 15:08:13 -0500 Subject: [PATCH 4/4] Revert "Point requirements.txt to dagrt fence-rename branch" This reverts commit fca15453de6b9b97b5fd7b7ecf36a44e66c2f180. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d13c137..e22f333 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ git+git://github.com/inducer/pytools git+git://github.com/inducer/pymbolic -git+https://gitlab.tiker.net/inducer/dagrt.git@fence-rename +git+https://gitlab.tiker.net/inducer/dagrt.git \ No newline at end of file -- GitLab