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

Undetected storage-related dependence with buffering in corner cases #1901

Closed
FabioLuporini opened this issue Apr 12, 2022 · 0 comments · Fixed by #1903
Closed

Undetected storage-related dependence with buffering in corner cases #1901

FabioLuporini opened this issue Apr 12, 2022 · 0 comments · Fixed by #1903
Assignees
Labels
bug-C bug in the generated code

Comments

@FabioLuporini
Copy link
Contributor

When one uses buffering in a dummy Operator with a parallel time dimension there is a race condition due to OpenMP-izing the time loop.

Reproducer:

    grid = Grid(shape=(2, 2))
    time = grid.time_dim
    x, y = grid.dimensions

    usave = TimeFunction(name='usave', grid=grid, save=10)
    v = TimeFunction(name='v', grid=grid)

    eq = [Eq(v[time, x, y], usave)]

    op = Operator(eq, opt='buffering')

    trees = retrieve_iteration_tree(op)
    assert len(trees) == 2
    assert trees[1].root.dim is time
    assert not trees[1].root.is_Parallel
    assert trees[1].root.is_Sequential  # Obv

The issue is that buffering creates a storage-related dependence and what was previously discovered to be PARALLEL should now be downgraded to SEQUENTIAL

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