Repository navigation
compiler: Revamp DDA for SubDimensions #3033
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
Changes from 2 commits
3c0f3ea
68f52ce
91540c5
beaa385
1c1616f
e92b29b
4ec3dc6
3fcd485
0fb9039
df6e187
30a0aff
3aaa843
49f8aca
867e30d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -818,6 +818,46 @@ def _arg_values(self, interval, grid=None, **kwargs): | |
| # themselves | ||
| return {} | ||
|
|
||
| def _arg_check(self, args, *_args, **kwargs): | ||
| # These modules depend on Dimension, so importing them above would cycle | ||
| from devito.mpi import mpi_raise # noqa: PLC0415 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this wouldn't be an issue with mpi_rais in exception.py with the rest of the exception stuff
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| from devito.symbolics import subs_op_args # noqa: PLC0415 | ||
|
|
||
| if not self.is_middle: | ||
| return | ||
|
|
||
| # Function._arg_check visits original axes (e.g. x_ltkn), whereas `args` | ||
| # contains the concretized thicknesses (x_ltkn0, ...). The Operator checks | ||
| # the matching concrete SubDimensions separately in its dimension loop | ||
| if self not in args.op.dimensions: | ||
| return | ||
|
|
||
| d = self.root | ||
| if args.grid is not None and args.grid.is_distributed(d): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure why kwargs would be ignored if the grid is not distributed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dropped, revamped, simplified |
||
| # Check the global runtime region: its MPI-local slices may be empty | ||
| # or smaller than space_order even for a non-degenerate global interior | ||
| size = args.grid.size_map[d].glb | ||
| values = {**args, | ||
| d.min_name: kwargs.get(d.min_name, 0), | ||
| d.max_name: kwargs.get(d.max_name, kwargs.get(d.name, size - 1)), | ||
| **{t.name: kwargs.get(t.name, t.value) for t in self.thickness}} | ||
| else: | ||
| values = args | ||
| size = int(subs_op_args(self.symbolic_size, values)) | ||
|
|
||
| # Runtime overrides do not change the compiled stencil order | ||
| items = [f.space_order for f in args.op.input if f.is_DiscreteFunction] | ||
| space_order = max(items, default=0) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dropped, revamped, simplified |
||
|
|
||
| if size < space_order: | ||
| error = (f"Expected at least {space_order} interior points along " | ||
| f"`{self.parent}` (space_order), but runtime arguments leave {size}") | ||
| else: | ||
| error = None | ||
|
|
||
| comm = args.comm if args.options['mpi'] else None | ||
| mpi_raise(error, InvalidArgument, comm=comm) | ||
|
|
||
|
|
||
| class MultiSubDimension(AbstractSubDimension): | ||
|
|
||
|
|
@@ -1436,7 +1476,7 @@ def _arg_values(self, interval, grid=None, args=None, **kwargs): | |
| # Avoid OOB (will end up here only in case of tiny iteration spaces) | ||
| return {name: 1} | ||
|
|
||
| def _arg_check(self, args, *_args): | ||
| def _arg_check(self, args, *_args, **kwargs): | ||
| try: | ||
| name = self.step.name | ||
| except AttributeError: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dropped, revamped, simplified