diff --git a/examples/adaptive-rk/adaptive-rk.py b/examples/adaptive-rk/adaptive-rk.py index 936d92d1f693b28756ac8e102cdecdf332d5386d..5362329430656c378583aeef3afe36063c760c8f 100755 --- a/examples/adaptive-rk/adaptive-rk.py +++ b/examples/adaptive-rk/adaptive-rk.py @@ -126,7 +126,7 @@ def demo_rk_adaptive(): var(name) for name in "k1 k2 k3 k4
dt_old y y_hi y_lo f norm_inf".split()) # noqa - with CodeBuilder() as cb: + with CodeBuilder("primary") as cb: # Calculate the RK stage values cb(k1, f(t, y)) cb(k2, f(t + 1/2 * dt, y + dt * (1/2 * k1))) diff --git a/examples/implicit_euler/implicit_euler.py b/examples/implicit_euler/implicit_euler.py index 63e03f3c1094e2b5ec146a13852657d55d723dc5..6ce1d9e031e476984578e29eb12e71f383017b6c 100644 --- a/examples/implicit_euler/implicit_euler.py +++ b/examples/implicit_euler/implicit_euler.py @@ -50,10 +50,12 @@ class ImplicitEulerMethod(Method): """Return code that implements the implicit Euler method for the single state component supported.""" - with CodeBuilder(label="primary") as cb: + with CodeBuilder(name="primary") as cb: self._make_primary(cb) - code = DAGCode.create_with_steady_phase(statements=cb.statements) + code = DAGCode.from_phases_list( + [cb.as_execution_phase(next_phase="primary")], + initial_phase="primary") from leap.implicit import replace_AssignImplicit diff --git a/examples/semi-implicit-rk/semi-implicit-rk.py b/examples/semi-implicit-rk/semi-implicit-rk.py index f940f69396cf24c1b04a94430b9092c0c5c00878..6f9fd158523df3fb20d2eaf867f1d92056bfad99 100755 --- a/examples/semi-implicit-rk/semi-implicit-rk.py +++ b/examples/semi-implicit-rk/semi-implicit-rk.py @@ -79,7 +79,7 @@ def demo_rk_implicit(): gamma = (2 - 2**0.5) / 2 - with CodeBuilder() as cb: + with CodeBuilder("primary") as cb: cb.assign_implicit_1( k1, solve_component=k1, diff --git a/leap/multistep/__init__.py b/leap/multistep/__init__.py index 8cd44d76ca14a91b6de9972ada2bb1361bed8aa8..c18155e6fdba8d1a3cf9ae0a2ab9488d6f70a2d6 100644 --- a/leap/multistep/__init__.py +++ b/leap/multistep/__init__.py @@ -272,11 +272,11 @@ class AdamsBashforthMethod(Method): rhs_var = var("rhs_var") # Initialization - with CodeBuilder(label="initialization") as cb_init: + with CodeBuilder(name="initialization") as cb_init: cb_init(self.step, 1) # Primary - with CodeBuilder(label="primary") as cb_primary: + with CodeBuilder(name="primary") as cb_primary: if not self.static_dt: time_history_data = self.time_history + [self.t] @@ -330,7 +330,7 @@ class AdamsBashforthMethod(Method): initial_phase="initial") # Bootstrap - with CodeBuilder(label="bootstrap") as cb_bootstrap: + with CodeBuilder(name="bootstrap") as cb_bootstrap: self.rk_bootstrap(cb_bootstrap) cb_bootstrap(self.t, self.t + self.dt) cb_bootstrap.yield_state(expression=self.state, diff --git a/leap/multistep/multirate/__init__.py b/leap/multistep/multirate/__init__.py index 54bca48d91f9714850659d455efbe9b7f72b5c77..8d172f9643edc4bc50288b3a3d7eb17d23b3bbce 100644 --- a/leap/multistep/multirate/__init__.py +++ b/leap/multistep/multirate/__init__.py @@ -1125,13 +1125,13 @@ class MultiRateMultiStepMethod(Method): from dagrt.language import DAGCode, CodeBuilder - with CodeBuilder(label="initialization") as cb_init: + with CodeBuilder(name="initialization") as cb_init: self.emit_initialization(cb_init) - with CodeBuilder(label="primary") as cb_primary: + with CodeBuilder(name="primary") as cb_primary: self.emit_ab_method(cb_primary, explainer) - with CodeBuilder(label="bootstrap") as cb_bootstrap: + with CodeBuilder(name="bootstrap") as cb_bootstrap: self.emit_rk_bootstrap(cb_bootstrap) return DAGCode( diff --git a/leap/rk/__init__.py b/leap/rk/__init__.py index 9d5061e594b298f499676884def087070139e8d1..9b474c58c43395501a3341686a25ca5634ca945c 100644 --- a/leap/rk/__init__.py +++ b/leap/rk/__init__.py @@ -172,7 +172,7 @@ class ButcherTableauMethod(Method): last_rhss = {} - with CodeBuilder(label="initialization") as cb: + with CodeBuilder(name="initialization") as cb: for name in stage_coeff_set_names: if ( name in self.recycle_last_stage_coeff_set_names @@ -203,7 +203,7 @@ class ButcherTableauMethod(Method): last_state_est_var = cb.fresh_var("last_state_est") last_state_est_var_valid = False - with CodeBuilder(label="primary") as cb: + with CodeBuilder(name="primary") as cb: equations = [] unknowns = set() diff --git a/leap/transform.py b/leap/transform.py index c321af0fc97400add246d4b85947821be9f3833c..77da714b477b5a80855a1954dca9d920b821ab40 100644 --- a/leap/transform.py +++ b/leap/transform.py @@ -134,18 +134,21 @@ def strang_splitting(dag1, dag2, stepping_phase): 4. Return u3 """ new_phases[phase_name] = ExecutionPhase( + name=phase_name, next_phase=s2_name, statements=( _update_t_by_dt_factor(0, _elide_yield_state( phase1_half_dt)))) new_phases[s2_name] = ExecutionPhase( + name=s2_name, next_phase=s3_name, statements=( _update_t_by_dt_factor(1/2, _elide_yield_state( substed_s2_stmts)))) new_phases[s3_name] = ExecutionPhase( + name=s3_name, next_phase=phase1.next_phase, statements=phase1_half_dt) else: diff --git a/leap/version.py b/leap/version.py index 74bb455b564e9cb676ea466c03fd92cdde8d74a2..0d96d97a7541d7b87196329b1912c2f2808cd501 100644 --- a/leap/version.py +++ b/leap/version.py @@ -1,2 +1,2 @@ -VERSION = (2019, 3) +VERSION = (2019, 4) VERSION_TEXT = ".".join(str(i) for i in VERSION) diff --git a/setup.py b/setup.py index b530f094ba01c382a6204f72655c06dfeb1e7f84..71e94f482ab03df58ce1b16890cf8ef7fe040bf9 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ def main(): "pytools>=2014.1", "pymbolic>=2014.1", "pytest>=2.3", - "dagrt>=2019.3", + "dagrt>=2019.4", "mako", "six", ],