diff --git a/grudge/execution.py b/grudge/execution.py index 4fe592dda96a69d410d4ec0d2b2e1ac28614415d..948be131205034a2d0ddb597a11d2c8ad8f42327 100644 --- a/grudge/execution.py +++ b/grudge/execution.py @@ -628,13 +628,14 @@ def bind(discr, sym_operator, post_bind_mapper=lambda x: x, allocator=allocator) if "dump_op_code" in debug_flags: - from grudge.tools import open_unique_debug_file + from pytools.debug import open_unique_debug_file outf, _ = open_unique_debug_file("op-code", ".txt") with outf: outf.write(str(bound_op)) if "dump_dataflow_graph" in debug_flags: - bound_op.code.dump_dataflow_graph() + discr_code.dump_dataflow_graph("discr") + eval_code.dump_dataflow_graph("eval") return bound_op diff --git a/grudge/symbolic/compiler.py b/grudge/symbolic/compiler.py index e425fa496411304b88cf305bc13364a1bc95e221..51eb5202acaa1d1ffa6c4cbc8b293eef4a25e54e 100644 --- a/grudge/symbolic/compiler.py +++ b/grudge/symbolic/compiler.py @@ -385,10 +385,15 @@ class Code(object): # self.last_schedule = None self.static_schedule_attempts = 5 - def dump_dataflow_graph(self): + def dump_dataflow_graph(self, name=None): from pytools.debug import open_unique_debug_file - outf, _ = open_unique_debug_file("dataflow", ".dot") + if name is None: + stem = "dataflow" + else: + stem = "dataflow-%s" % name + + outf, _ = open_unique_debug_file(stem, ".dot") with outf: outf.write(dot_dataflow_graph(self, max_node_label_length=None))