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

Functions on subdomains (WIP) #1380

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Functions on subdomains (WIP) #1380

wants to merge 18 commits into from

Conversation

rhodrin
Copy link
Contributor

@rhodrin rhodrin commented Jul 7, 2020

This PR adds the ability to define Function's on SubDomain's, e.g.

f = Function(name='f', grid=grid, subdomain=grid.subdomains['middle'])

The shape of the Data allocated will then be grid.subdomains['middle'].shape (or grid.subdomains['middle'].shape_local on each rank with MPI).

NOTE: Submitting for testing. Lots of changes and refactoring are still required.

@codecov
Copy link

codecov bot commented Jul 7, 2020

Codecov Report

Merging #1380 into master will decrease coverage by 0.24%.
The diff coverage is 95.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1380      +/-   ##
==========================================
- Coverage   87.00%   86.75%   -0.25%     
==========================================
  Files         188      188              
  Lines       27354    26257    -1097     
  Branches     3712     3740      +28     
==========================================
- Hits        23799    22779    -1020     
+ Misses       3126     3048      -78     
- Partials      429      430       +1     
Impacted Files Coverage Δ
devito/types/grid.py 91.05% <85.50%> (-2.43%) ⬇️
devito/ir/equations/algorithms.py 100.00% <100.00%> (ø)
devito/operations/interpolators.py 90.85% <100.00%> (+0.67%) ⬆️
devito/types/dense.py 93.14% <100.00%> (-0.54%) ⬇️
tests/test_caching.py 99.74% <100.00%> (-0.01%) ⬇️
tests/test_subdomains.py 100.00% <100.00%> (ø)
devito/ir/support/stencil.py 51.56% <0.00%> (-3.51%) ⬇️
tests/test_gpu_openacc.py 34.17% <0.00%> (-3.18%) ⬇️
examples/seismic/utils.py 74.78% <0.00%> (-3.08%) ⬇️
tests/test_tensors.py 84.26% <0.00%> (-2.14%) ⬇️
... and 106 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9cdb8e6...05e56b7. Read the comment docs.

@rhodrin rhodrin added enhancement testing WIP Still work in progress labels Jul 7, 2020
@@ -349,28 +349,30 @@ def __init__(self):
raise ValueError("SubDomain requires a `name`")
self._dimensions = None

def __subdomain_finalize__(self, dimensions, shape, **kwargs):
def __subdomain_finalize__(self, dimensions, shape, distributor=None, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I like the new sd terminology...

@rhodrin rhodrin force-pushed the fns_on_subdomains branch 2 times, most recently from bd0f90e to 980e8c4 Compare July 29, 2020 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing WIP Still work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants