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

compiler: Cyclic rotation is broken #113

Open
georgebisbas opened this issue Jul 18, 2024 · 0 comments
Open

compiler: Cyclic rotation is broken #113

georgebisbas opened this issue Jul 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@georgebisbas
Copy link
Collaborator

This problem is seen only with different initial data in buffers

@pytest.mark.parametrize('shape, rtol', [(5, 1e-5), (100, 1e-6)])
def test_precision_II(shape, rtol):
    # Define an upper bound of precision

    nt = 1
    grid = Grid(shape=(shape,))
    u = TimeFunction(name='u', grid=grid, time_order=2, space_order=2)

    init0 = 1.
    init1 = 2.
    init2 = 3.

    dt = 0.1
    u.data[0, :] = init0
    u.data[1, :] = init1
    u.data[2, :] = init2

    import pdb; pdb.set_trace()

    pde = u.dt2 - u.laplace
    stencil = Eq(u.forward, solve(pde, u.forward))

    opd = Operator([stencil])
    opd.apply(time_M=nt, dt=dt)
    dnorm = norm(u)
    dnorm0 = np.linalg.norm(u.data[0])

    import pdb; pdb.set_trace()

    u.data[0, :] = init0
    u.data[1, :] = init1
    u.data[2, :] = init2

    opx = Operator([stencil], opt='xdsl')
    opx.apply(time_M=nt, dt=dt)
    xnorm = norm(u)
    xnorm0 = np.linalg.norm(u.data[0])

    import pdb; pdb.set_trace()

    assert np.isclose(dnorm0, xnorm0, atol=0, rtol=rtol)
    assert np.isclose(dnorm, xnorm, atol=0, rtol=rtol)

@georgebisbas georgebisbas added the bug Something isn't working label Jul 18, 2024
@georgebisbas georgebisbas self-assigned this Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant