devito icon indicating copy to clipboard operation
devito copied to clipboard

dsl: Move SubDimension thickness evaluation to the thicknesses themselves

Open EdCaunt opened this issue 1 year ago • 1 comments

Fixes issues with standalone use of SubDimension.symbolic_min or SubDimension.symbolic_max in an operator. Previously variants on

x = Dimension('x')
ix = SubDimension.left('ix', x, 2)
f = Function(name="f", dimensions=(ix,), shape=(5,), dtype=np.int32)

eqns = Eq(f[ix.symbolic_max], 1)

op = Operator(eqns)
op(x_m=0)

would suffer from two issues:

  1. The SubDimension thickness (ix.symbolic_max) would not be concretised from x_ltkn to x_ltkn0
  2. The SubDimension thickness would never be given a value by _arg_values unless the user explicitly passed it to the operator (and even then, it would not be adjusted to reflect any MPI decomposition)

These are rectified by this PR.

EdCaunt avatar Oct 18 '24 14:10 EdCaunt

Codecov Report

Attention: Patch coverage is 97.03704% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.26%. Comparing base (2f4f80f) to head (6e7c017). Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
devito/ir/equations/algorithms.py 81.81% 1 Missing and 1 partial :warning:
devito/types/dimension.py 97.82% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2470      +/-   ##
==========================================
+ Coverage   87.22%   87.26%   +0.04%     
==========================================
  Files         238      238              
  Lines       45258    45278      +20     
  Branches     4019     4022       +3     
==========================================
+ Hits        39475    39512      +37     
+ Misses       5103     5085      -18     
- Partials      680      681       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 18 '24 14:10 codecov[bot]

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Merged, thanks

FabioLuporini avatar Nov 13 '24 08:11 FabioLuporini