From 7a8b6044250a1ed99a369664065deb63e84955ce Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 11 Dec 2018 11:31:51 -0600 Subject: [PATCH 1/5] Fix usage sites of open_unique_debug_file (reported by Fan Kiat Chan) --- grudge/execution.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grudge/execution.py b/grudge/execution.py index 9d665cb3..c20aa4bc 100644 --- a/grudge/execution.py +++ b/grudge/execution.py @@ -655,8 +655,9 @@ def bind(discr, sym_operator, post_bind_mapper=lambda x: x, if "dump_op_code" in debug_flags: from grudge.tools import open_unique_debug_file - open_unique_debug_file("op-code", ".txt").write( - str(bound_op)) + 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() -- GitLab From af7015e8f7c6d56f20b418c8d0498d692bf67afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Fri, 1 Feb 2019 04:25:54 +0100 Subject: [PATCH 2/5] Avoid using specific Py3 sub-versions for CI --- .gitlab-ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b957ee9e..fcee7997 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,15 +15,15 @@ Python 2.7 POCL: reports: junit: test/pytest.xml -Python 3.6 POCL: +Python 3 POCL: script: - - export PY_EXE=python3.6 + - export PY_EXE=python3 - export PYOPENCL_TEST=portable - export EXTRA_INSTALL="pybind11 numpy mako" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: - - python3.6 + - python3 - pocl - mpi except: @@ -50,16 +50,16 @@ Python 2.7 POCL MPI: reports: junit: test/pytest.xml -Python 3.6 POCL MPI: +Python 3 POCL MPI: script: - - export PY_EXE=python3.6 + - export PY_EXE=python3 - export PYOPENCL_TEST=portable - export EXTRA_INSTALL="pybind11 numpy mako mpi4py pymetis" - export PYTEST_ADDOPTS="-k mpi" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: - - python3.6 + - python3 - pocl - mpi except: @@ -74,7 +74,7 @@ Documentation: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-docs.sh - ". ./build-docs.sh" tags: - - python3.6 + - python3 only: - master @@ -83,6 +83,6 @@ Flake8: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh - ". ./prepare-and-run-flake8.sh grudge test" tags: - - python3.6 + - python3 except: - tags -- GitLab From d0c84efbc86cf29fef2f941c0f18ee8216c6635b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Fri, 1 Feb 2019 04:30:52 +0100 Subject: [PATCH 3/5] Fix comment indentation --- grudge/symbolic/mappers/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/grudge/symbolic/mappers/__init__.py b/grudge/symbolic/mappers/__init__.py index c2fba3d6..d52f7ac5 100644 --- a/grudge/symbolic/mappers/__init__.py +++ b/grudge/symbolic/mappers/__init__.py @@ -550,11 +550,11 @@ class OperatorSpecializer(CSECachingMapperMixin, IdentityMapper): elif (isinstance(expr.op, op.QuadratureGridUpsampler) and isinstance(field_type, type_info.BoundaryVectorBase)): # potential shortcut: - #if (isinstance(expr.field, OperatorBinding) - #and isinstance(expr.field.op, RestrictToBoundary)): - #return QuadratureRestrictToBoundary( - #expr.field.op.tag, expr.op.quadrature_tag)( - #self.rec(expr.field.field)) + # if (isinstance(expr.field, OperatorBinding) + # and isinstance(expr.field.op, RestrictToBoundary)): + # return QuadratureRestrictToBoundary( + # expr.field.op.tag, expr.op.quadrature_tag)( + # self.rec(expr.field.field)) return op.QuadratureBoundaryGridUpsampler( expr.op.quadrature_tag, field_type.boundary_tag)(expr.field) -- GitLab From d84790474113b96045a7290b55c1a061ba905e20 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 3 Feb 2019 13:44:47 -0600 Subject: [PATCH 4/5] Fix dataflow graph dumping --- grudge/symbolic/compiler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grudge/symbolic/compiler.py b/grudge/symbolic/compiler.py index 53db42f1..b27d5585 100644 --- a/grudge/symbolic/compiler.py +++ b/grudge/symbolic/compiler.py @@ -385,8 +385,9 @@ class Code(object): def dump_dataflow_graph(self): from pytools.debug import open_unique_debug_file - open_unique_debug_file("dataflow", ".dot")\ - .write(dot_dataflow_graph(self, max_node_label_length=None)) + outf, _ = open_unique_debug_file("dataflow", ".dot") + with outf: + outf.write(dot_dataflow_graph(self, max_node_label_length=None)) def __str__(self): var_to_writer = dict( -- GitLab From 785e9948d52d51e09175b08721b56fed058880e7 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 3 Feb 2019 13:47:31 -0600 Subject: [PATCH 5/5] Add missing Ones.__getinitargs__ --- grudge/symbolic/primitives.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grudge/symbolic/primitives.py b/grudge/symbolic/primitives.py index 2afb3d21..231a70df 100644 --- a/grudge/symbolic/primitives.py +++ b/grudge/symbolic/primitives.py @@ -425,6 +425,9 @@ class PrioritizedSubexpression(pymbolic.primitives.CommonSubexpression): class Ones(ExpressionBase, HasDOFDesc): + def __getinitargs__(self): + return () + mapper_method = intern("map_ones") -- GitLab