diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b957ee9e37d5d4197fd9804429f0414ec4f6b7aa..fcee7997ab48e1ac9c51782aae6347c73e10a3bf 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 diff --git a/grudge/execution.py b/grudge/execution.py index 9d665cb359c618bb0a07e3a030efef966cbbdc77..c20aa4bc6271f1b9a8f5620c8b3021c22563880c 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() diff --git a/grudge/symbolic/compiler.py b/grudge/symbolic/compiler.py index 53db42f18665fa37582c6e92afc5b214916f8e66..b27d55855237b5e0200b094c2aa164e192022f0b 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( diff --git a/grudge/symbolic/mappers/__init__.py b/grudge/symbolic/mappers/__init__.py index c2fba3d6a757fa9ed80babf4f7315707bf4e7858..d52f7ac5bf99adbb16a618a8c3cb44fb8c65c515 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) diff --git a/grudge/symbolic/primitives.py b/grudge/symbolic/primitives.py index 2afb3d21bdd6639480691c3e904386f809641d00..231a70dfa374d8c0e60e2830ff13427f5d33c0dd 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")