We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Sub expression elimination behaves strangely on subdomains if you replace a dimension with a Symbol.
This code:
from devito import Grid, TimeFunction, Eq, solve, Operator from devito.types import Symbol grid = Grid(shape=(5, 5), extent=(1., 1.)) f = TimeFunction(name='f', grid=grid, space_order=2) g = TimeFunction(name='g', grid=grid, space_order=2) mapper = {grid.stepping_dim: Symbol('tau')} eq = Eq(f.dt, g.laplace) stencil = solve(eq, f.forward) update = Eq(f.forward, stencil, subdomain=grid.interior).subs(mapper) op = Operator([update])
produces the following loop:
START(section0) for (int x = x_ltkn0 + x_m; x <= x_M - x_rtkn0; x += 1) { for (int y = y_ltkn0 + y_m; y <= y_M - y_rtkn0; y += 1) { f[tau + 1][x + 2][y + 2] = dt*(g[tau][x + 1][y + 2]/((h_x*h_x)) - 2.0F*g[tau][x + 2][y + 2]/(h_x*h_x) + g[tau][x + 3][y + 2]/((h_x*h_x)) + g[tau][x + 2][y + 1]/((h_y*h_y)) - 2.0F*g[tau][x + 2][y + 2]/(h_y*h_y) + g[tau][x + 2][y + 3]/((h_y*h_y)) + f[tau][x + 2][y + 2]/dt); } } STOP(section0,timers)
The issues are:
Temp
If you remove subdomain=grid.interior then the generated code is as expected:
subdomain=grid.interior
float r0 = 1.0F/dt; float r1 = 1.0F/(h_x*h_x); float r2 = 1.0F/(h_y*h_y); START(section0) for (int x = x_m; x <= x_M; x += 1) { #pragma omp simd aligned(f,g:32) for (int y = y_m; y <= y_M; y += 1) { f[tau + 1][x + 2][y + 2] = dt*(r0*f[tau][x + 2][y + 2] + r1*g[tau][x + 1][y + 2] + r1*g[tau][x + 3][y + 2] + r2*g[tau][x + 2][y + 1] + r2*g[tau][x + 2][y + 3] + (-2.0F)*(r1*g[tau][x + 2][y + 2] + r2*g[tau][x + 2][y + 2])); } } STOP(section0,timers)
The text was updated successfully, but these errors were encountered:
FabioLuporini
mloubout
ZoeLeibowitz
No branches or pull requests
Sub expression elimination behaves strangely on subdomains if you replace a dimension with a Symbol.
This code:
produces the following loop:
The issues are:
Temp
expressions are generatedIf you remove
subdomain=grid.interior
then the generated code is as expected:The text was updated successfully, but these errors were encountered: