Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We can rely on having tinyasm installed #3815

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions firedrake/preconditioners/asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
from firedrake.petsc import PETSc
from firedrake.dmhooks import get_function_space
from firedrake.logging import warning
from tinyasm import _tinyasm as tinyasm
import numpy

try:
from tinyasm import _tinyasm as tinyasm
have_tinyasm = True
except ImportError:
have_tinyasm = False


__all__ = ("ASMPatchPC", "ASMStarPC", "ASMVankaPC", "ASMLinesmoothPC", "ASMExtrudedStarPC")

Expand Down Expand Up @@ -77,9 +72,6 @@ def initialize(self, pc):
ises = tuple(lgmap.applyIS(iset) for iset in ises)
asmpc.setASMLocalSubdomains(len(ises), ises)
elif backend == "tinyasm":
if not have_tinyasm:
raise ValueError("To use the TinyASM backend you need to install firedrake with TinyASM (firedrake-update --tinyasm)")

_, P = asmpc.getOperators()
lgmap = V.dof_dset.lgmap
P.setLGMap(rmap=lgmap, cmap=lgmap)
Expand Down
7 changes: 1 addition & 6 deletions tests/regression/test_linesmoother.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import pytest
from firedrake import *
try:
import tinyasm # noqa: F401
marks = ()
except ImportError:
marks = pytest.mark.skip(reason="No tinyasm")


@pytest.fixture(params=["Interval", "Triangle", "Quad"])
Expand Down Expand Up @@ -43,7 +38,7 @@ def expected(mesh_type):
return [5, 11]


@pytest.fixture(params=["petscasm", pytest.param("tinyasm", marks=marks)])
@pytest.fixture(params=["petscasm", "tinyasm"])
def backend(request):
return request.param

Expand Down
7 changes: 1 addition & 6 deletions tests/regression/test_star_pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
import warnings
from firedrake import *
from firedrake.petsc import DEFAULT_DIRECT_SOLVER
try:
import tinyasm # noqa: F401
marks = ()
except ImportError:
marks = pytest.mark.skip(reason="No tinyasm")


@pytest.fixture(params=["scalar",
Expand All @@ -16,7 +11,7 @@ def problem_type(request):
return request.param


@pytest.fixture(params=["petscasm", pytest.param("tinyasm", marks=marks)])
@pytest.fixture(params=["petscasm", "tinyasm"])
def backend(request):
return request.param

Expand Down
Loading