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

buffering of Function accessed with stencil is broken #1915

Closed
FabioLuporini opened this issue May 3, 2022 · 0 comments · Fixed by #1916
Closed

buffering of Function accessed with stencil is broken #1915

FabioLuporini opened this issue May 3, 2022 · 0 comments · Fixed by #1916
Assignees
Labels
bug-C bug in the generated code

Comments

@FabioLuporini
Copy link
Contributor

The issue is that the buffer halo isn't initialized, so instead of zeros, garbage is read.

    nt = 5
    grid = Grid(shape=(4, 4))

    u = TimeFunction(name='u', grid=grid, space_order=4, save=nt)
    u1 = TimeFunction(name='u', grid=grid, space_order=4, save=nt)

    eqn = Eq(u.forward, u.dx + 1)

    op0 = Operator(eqn, opt='noop')
    op1 = Operator(eqn, opt='buffering')

    op0.apply(time_M=nt-2)
    op1.apply(time_M=nt-2, u=u1)

    assert np.all(u.data == u1.data)
@FabioLuporini FabioLuporini added the bug-C bug in the generated code label May 3, 2022
@FabioLuporini FabioLuporini self-assigned this May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-C bug in the generated code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant