-
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
test_ds_prism [float64] is failing on s390x,
test log at https://ci.debian.net/packages/f/fenics-ffcx/testing/s390x/67306878/
142s =================================== FAILURES ===================================
142s ____________________________ test_ds_prism[float64] ____________________________
142s
142s compile_args = ['-O1', '-Wall', '-Werror'], dtype = 'float64'
142s
142s @pytest.mark.parametrize("dtype", ["float64"])
142s def test_ds_prism(compile_args, dtype):
142s element = basix.ufl.element("Lagrange", "prism", 1)
142s domain = ufl.Mesh(basix.ufl.element("Lagrange", "prism", 1, shape=(3,)))
142s space = ufl.FunctionSpace(domain, element)
142s u, v = ufl.TrialFunction(space), ufl.TestFunction(space)
142s
142s a = ufl.inner(u, v) * ufl.ds
142s forms = [a]
142s compiled_forms, module, _code = ffcx.codegeneration.jit.compile_forms(
142s forms, options={"scalar_type": dtype}, cffi_extra_compile_args=compile_args
142s )
142s
142s for f, compiled_f in zip(forms, compiled_forms):
142s assert compiled_f.rank == len(f.arguments())
142s
142s ffi = module.ffi
142s form0 = compiled_forms[0]
142s
142s offsets = form0.form_integral_offsets
142s cell = module.lib.cell
142s exterior_facet = module.lib.exterior_facet
142s interior_facet = module.lib.interior_facet
142s assert offsets[cell + 1] - offsets[cell] == 0
142s assert offsets[exterior_facet + 1] - offsets[exterior_facet] == 2
142s assert offsets[interior_facet + 1] - offsets[interior_facet] == 0
142s
142s integral_id0 = form0.form_integral_ids[offsets[exterior_facet]]
142s integral_id1 = form0.form_integral_ids[offsets[exterior_facet] + 1]
142s assert integral_id0 == integral_id1 == -1
142s
142s integral0 = form0.form_integrals[offsets[exterior_facet]]
142s integral1 = form0.form_integrals[offsets[exterior_facet] + 1]
142s
142s if basix.CellType(integral0.domain) == basix.CellType.triangle:
142s assert basix.CellType(integral1.domain) == basix.CellType.quadrilateral
142s integral_tri = integral0
142s integral_quad = integral1
142s else:
142s assert basix.CellType(integral0.domain) == basix.CellType.quadrilateral
142s assert basix.CellType(integral1.domain) == basix.CellType.triangle
142s integral_tri = integral1
142s integral_quad = integral0
142s
142s w = np.array([], dtype=dtype)
142s c = np.array([], dtype=dtype)
142s entity_perm = np.array([0], dtype=np.uint8)
142s
142s # Test integral over triangle (facet 0)
142s A = np.zeros((6, 6), dtype=dtype)
142s entity_index = np.array([0], dtype=int)
142s
142s xdtype = dtype_to_scalar_dtype(dtype)
142s coords = np.array(
142s [
142s [0.0, 0.0, 0.0],
142s [1.0, 0.0, 0.0],
142s [0.0, 1.0, 0.0],
142s [0.0, 0.0, 1.0],
142s [1.0, 0.0, 1.0],
142s [0.0, 1.0, 1.0],
142s ],
142s dtype=xdtype,
142s )
142s
142s c_type, c_xtype = dtype_to_c_type(dtype), dtype_to_c_type(xdtype)
142s
142s kernel = getattr(integral_tri, f"tabulate_tensor_{dtype}")
142s
142s kernel(
142s ffi.cast(f"{c_type} *", A.ctypes.data),
142s ffi.cast(f"{c_type} *", w.ctypes.data),
142s ffi.cast(f"{c_type} *", c.ctypes.data),
142s ffi.cast(f"{c_xtype} *", coords.ctypes.data),
142s ffi.cast("int *", entity_index.ctypes.data),
142s ffi.cast("uint8_t *", entity_perm.ctypes.data),
142s ffi.NULL,
142s )
142s
142s assert np.allclose(
142s A,
142s np.array(
142s [
142s [1 / 12, 1 / 24, 1 / 24, 0, 0, 0],
142s [1 / 24, 1 / 12, 1 / 24, 0, 0, 0],
142s [1 / 24, 1 / 24, 1 / 12, 0, 0, 0],
142s [0, 0, 0, 0, 0, 0],
142s [0, 0, 0, 0, 0, 0],
142s [0, 0, 0, 0, 0, 0],
142s ]
142s ),
142s )
142s
142s # Test integral over quadrilateral (facet 1)
142s A = np.zeros((6, 6), dtype=dtype)
142s entity_index = np.array([1], dtype=np.int64)
142s
142s xdtype = dtype_to_scalar_dtype(dtype)
142s coords = np.array(
142s [
142s [0.0, 0.0, 0.0],
142s [1.0, 0.0, 0.0],
142s [0.0, 1.0, 0.0],
142s [0.0, 0.0, 1.0],
142s [1.0, 0.0, 1.0],
142s [0.0, 1.0, 1.0],
142s ],
142s dtype=xdtype,
142s )
142s
142s c_type, c_xtype = dtype_to_c_type(dtype), dtype_to_c_type(xdtype)
142s
142s kernel = getattr(integral_quad, f"tabulate_tensor_{dtype}")
142s
142s kernel(
142s ffi.cast(f"{c_type} *", A.ctypes.data),
142s ffi.cast(f"{c_type} *", w.ctypes.data),
142s ffi.cast(f"{c_type} *", c.ctypes.data),
142s ffi.cast(f"{c_xtype} *", coords.ctypes.data),
142s ffi.cast("int *", entity_index.ctypes.data),
142s ffi.cast("uint8_t *", entity_perm.ctypes.data),
142s ffi.NULL,
142s )
142s
142s > assert np.allclose(
142s A,
142s np.array(
142s [
142s [1 / 9, 1 / 18, 0, 1 / 18, 1 / 36, 0],
142s [1 / 18, 1 / 9, 0, 1 / 36, 1 / 18, 0],
142s [0, 0, 0, 0, 0, 0],
142s [1 / 18, 1 / 36, 0, 1 / 9, 1 / 18, 0],
142s [1 / 36, 1 / 18, 0, 1 / 18, 1 / 9, 0],
142s [0, 0, 0, 0, 0, 0],
142s ]
142s ),
142s )
142s E assert False
142s E + where False = <function allclose at 0x3ff8002f8f0>(array([[ 0.16666667, -0.08333333, -0.08333333, 0. , 0. ,\n 0. ],\n [-0.08333333, 0.33333333, 0.25 , 0. , 0. ,\n 0. ],\n [-0.08333333, 0.25 , 0.33333333, 0. , 0. ,\n 0. ],\n [ 0. , 0. , 0. , 0. , 0. ,\n 0. ],\n [ 0. , 0. , 0. , 0. , 0. ,\n 0. ],\n [ 0. , 0. , 0. , 0. , 0. ,\n 0. ]]), array([[0.11111111, 0.05555556, 0. , 0.05555556, 0.02777778,\n 0. ],\n [0.05555556, 0.11111111, 0. , 0.02777778, 0.05555556,\n 0. ],\n [0. , 0. , 0. , 0. , 0. ,\n 0. ],\n [0.05555556, 0.02777778, 0. , 0.11111111, 0.05555556,\n 0. ],\n [0.02777778, 0.05555556, 0. , 0.05555556, 0.11111111,\n 0. ],\n [0. , 0. , 0. , 0. , 0. ,\n 0. ]]))
142s E + where <function allclose at 0x3ff8002f8f0> = np.allclose
142s E + and array([[0.11111111, 0.05555556, 0. , 0.05555556, 0.02777778,\n 0. ],\n [0.05555556, 0.11111111, 0. , 0.02777778, 0.05555556,\n 0. ],\n [0. , 0. , 0. , 0. , 0. ,\n 0. ],\n [0.05555556, 0.02777778, 0. , 0.11111111, 0.05555556,\n 0. ],\n [0.02777778, 0.05555556, 0. , 0.05555556, 0.11111111,\n 0. ],\n [0. , 0. , 0. , 0. , 0. ,\n 0. ]]) = <built-in function array>([[0.1111111111111111, 0.05555555555555555, 0, 0.05555555555555555, 0.027777777777777776, 0], [0.05555555555555555, 0.1111111111111111, 0, 0.027777777777777776, 0.05555555555555555, 0], [0, 0, 0, 0, 0, 0], [0.05555555555555555, 0.027777777777777776, 0, 0.1111111111111111, 0.05555555555555555, 0], [0.027777777777777776, 0.05555555555555555, 0, 0.05555555555555555, 0.1111111111111111, 0], [0, 0, 0, 0, 0, 0]])
142s E + where <built-in function array> = np.array
142s
142s /tmp/autopkgtest-lxc.nynvsvx6/downtmp/build.Ir2/src/test/test_jit_forms.py:1417: AssertionError
142s =========================== short test summary info ============================
142s SKIPPED [4] test/test_signatures.py:67: Numba not installed
142s FAILED test/test_jit_forms.py::test_ds_prism[float64] - assert False
142s ============= 1 failed, 197 passed, 4 skipped in 64.56s (0:01:04) ==============
I'll skip the test in the debian build in the meantime.
Metadata
Metadata
Assignees
Labels
No labels