diff --git a/dagrt/language.py b/dagrt/language.py index 9e5fb1685b936f6a7479315f5c9e4c15848b31a1..708b8d9e8a2eb6ee21e42c5ae5f6328d713c146c 100644 --- a/dagrt/language.py +++ b/dagrt/language.py @@ -819,7 +819,7 @@ class CodeBuilder(object): as the root dependencies, the phase can be executed by following the dependency list of each statement. - .. automethod:: fence + .. automethod:: reset_dep_tracking .. automethod:: if_ .. automethod:: else_ .. automethod:: __call__ @@ -876,7 +876,7 @@ class CodeBuilder(object): self._all_var_names = set() self._all_generated_var_names = set() - def fence(self): + def reset_dep_tracking(self): """ Enter a new logical block of statements. Force all prior statements to execute before subsequent ones. @@ -1171,19 +1171,19 @@ class CodeBuilder(object): time_id=time_id)) def fail_step(self): - self.fence() + self.reset_dep_tracking() self._add_inst_to_context(FailStep()) def restart_step(self): - self.fence() + self.reset_dep_tracking() self._add_inst_to_context(RestartStep()) def raise_(self, error_condition, error_message=None): - self.fence() + self.reset_dep_tracking() self._add_inst_to_context(Raise(error_condition, error_message)) def switch_phase(self, next_phase): - self.fence() + self.reset_dep_tracking() self._add_inst_to_context(SwitchPhase(next_phase)) def __enter__(self): @@ -1191,7 +1191,7 @@ class CodeBuilder(object): return self def __exit__(self, *ignored): - self.fence() + self.reset_dep_tracking() self.phase_dependencies = list(self._contexts[-1].lead_statement_ids) self.statements = set(self._statement_map.values()) diff --git a/dagrt/version.py b/dagrt/version.py index 78a7f0b5f35e6402a55367e5a38d626b9aa881fd..b8345dcde7d523978a5e5aa3767bf2a76c09ccde 100644 --- a/dagrt/version.py +++ b/dagrt/version.py @@ -1,2 +1,2 @@ -VERSION = (2019, 1) +VERSION = (2019, 2) VERSION_TEXT = ".".join(str(i) for i in VERSION) diff --git a/examples/adaptive_rk.py b/examples/adaptive_rk.py index 18f8a4cb9ca478e85ec2ed8d9bdebf071f0253ea..c2b093dca5fa4799bc7939f9c5b1045a4f33af7a 100644 --- a/examples/adaptive_rk.py +++ b/examples/adaptive_rk.py @@ -68,7 +68,7 @@ def adaptive_rk_method(tol): # Adaptation cb(dt_old, dt) - cb.fence() + cb.reset_dep_tracking() cb(dt, dt * dt_scaling(tol, y_h - y_e)) # Accept or reject step diff --git a/test/test_code_builder.py b/test/test_code_builder.py index 1ef7a66ad4046ba04eb1284d2261b073b6f6b4da..0641a80606e80bd13b098c66d35a4b19dd123669 100755 --- a/test/test_code_builder.py +++ b/test/test_code_builder.py @@ -147,7 +147,7 @@ def test_CodeBuilder_restart_step(python_method_impl): with CodeBuilder() as builder1: builder1("

x", 1) builder1.restart_step() - builder1.fence() + builder1.reset_dep_tracking() builder1("

x", 2) with CodeBuilder() as builder2: diff --git a/test/test_codegen_fortran.py b/test/test_codegen_fortran.py index 3e690c05ebcc746f2b6c5aa181a5c004c2288bfd..df4cf8289e1659a255594f8b4c164304d1dc68b3 100755 --- a/test/test_codegen_fortran.py +++ b/test/test_codegen_fortran.py @@ -76,20 +76,20 @@ def test_arrays_and_linalg(): cb("nodes", "`array`(n)") cb("vdm", "`array`(n*n)") cb("identity", "`array`(n*n)") - cb.fence() + cb.reset_dep_tracking() cb("nodes[i]", "i/n", loops=[("i", 0, "n")]) cb("identity[i]", "0", loops=[("i", 0, "n*n")]) - cb.fence() + cb.reset_dep_tracking() cb("identity[i*n + i]", "1", loops=[("i", 0, "n")]) cb("vdm[j*n + i]", "nodes[i]**j", loops=[("i", 0, "n"), ("j", 0, "n")]) - cb.fence() + cb.reset_dep_tracking() cb("vdm_inverse", "`linear_solve`(vdm, identity, n, n)") cb("myarray", "`matmul`(vdm, vdm_inverse, n, n)") diff --git a/test/test_codegen_python.py b/test/test_codegen_python.py index ff0b29ebeee16474a177fcbf99af392b2faf969f..d2eb7ff7e0e79c107ec9c4d35c32ecf0fbe7c93a 100755 --- a/test/test_codegen_python.py +++ b/test/test_codegen_python.py @@ -334,7 +334,7 @@ def test_IfThenElse_expansion(python_method_impl): def test_arrays_and_looping(python_method_impl): with CodeBuilder(label="primary") as cb: cb("myarray", "`array`(20)") - cb.fence() + cb.reset_dep_tracking() cb("myarray[i]", "i", loops=[("i", 0, 20)]) cb.yield_state("myarray[15]", "result", 0, "final") @@ -352,20 +352,20 @@ def test_arrays_and_linalg(python_method_impl): cb("nodes", "`array`(n)") cb("vdm", "`array`(n*n)") cb("identity", "`array`(n*n)") - cb.fence() + cb.reset_dep_tracking() cb("nodes[i]", "i/n", loops=[("i", 0, "n")]) cb("identity[i]", "0", loops=[("i", 0, "n*n")]) - cb.fence() + cb.reset_dep_tracking() cb("identity[i*n + i]", "1", loops=[("i", 0, "n")]) cb("vdm[j*n + i]", "nodes[i]**j", loops=[("i", 0, "n"), ("j", 0, "n")]) - cb.fence() + cb.reset_dep_tracking() cb("vdm_inverse", "`linear_solve`(vdm, identity, n, n)") cb("myarray", "`matmul`(vdm, vdm_inverse, n, n)") @@ -391,7 +391,7 @@ def test_svd(python_method_impl): cb("nodes", "`array`(n)") cb("vdm", "`array`(n*n)") cb("identity", "`array`(n*n)") - cb.fence() + cb.reset_dep_tracking() cb("nodes[i]", "i/n", loops=[("i", 0, "n")]) @@ -399,10 +399,10 @@ def test_svd(python_method_impl): cb("vdm[j*n + i]", "nodes[i]**j", loops=[("i", 0, "n"), ("j", 0, "n")]) - cb.fence() + cb.reset_dep_tracking() cb("vdm_u, vdm_sigma, vdm_vt", "`svd`(vdm, n)") - cb.fence() + cb.reset_dep_tracking() cb("vdm_usigma", "`array`(n*n)") cb("vdm_v", "`array`(n*n)") cb("vdm_usigma[i + j*n]", "vdm_u[i + j*n] * vdm_sigma[j]",