Repository navigation
compiler: Fix IET reconstruction with MPI overlap/full modes - #3112
FabioLuporini wants to merge 10 commits into
Conversation
0838b01 to
0c09c80
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3112 +/- ##
==========================================
- Coverage 84.35% 84.25% -0.10%
==========================================
Files 260 260
Lines 59230 59431 +201
Branches 5009 5019 +10
==========================================
+ Hits 49962 50073 +111
- Misses 8432 8522 +90
Partials 836 836
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| def dynamic_defaults(self): | ||
| return {k: tuple(self.parameters[i] for i in v) for k, v in self._mapper.items()} | ||
| def region(self): | ||
| return next((i for i in self.parameters if isinstance(i, Region)), None) |
There was a problem hiding this comment.
A slightly odd construction, but I guess it makes extracting the first parameter that's a Region into a one-liner
There was a problem hiding this comment.
yes. This is getting generated quite frequently. I checked it, and it's said to be pythonic 🤷♂️
|
|
||
| def make_call(self, region=None, retobj=None, is_indirect=False): | ||
| if region is not None and self.region is None: | ||
| raise ValueError("No region parameter") |
There was a problem hiding this comment.
Maybe reference self in this error message to make it usable for debugging?
|
|
||
| def __init__(self, name, body, retval='void', parameters=None, prefix=('static',), | ||
| dynamic_parameters=None): | ||
| def __init__(self, name, body, retval='void', parameters=None, prefix=('static',)): |
There was a problem hiding this comment.
What was dynamic_parameters? I remember it giving me grief with functions on subdomains and full/overlap modes, but never got to the bottom of it
There was a problem hiding this comment.
the y_m/y_M/z_m/... symbols , used as formal parameters in an ElementalFunction to describe the halo region geometry
| try: | ||
| if isinstance(a.function, Region): | ||
| return a | ||
| except AttributeError: |
| # Matching layouts must share a C type to permit compute helper reuse | ||
| for existing in self.regions: | ||
| if existing.pfields == region.pfields: | ||
| return region._rebuild(pname=existing.pname) |
There was a problem hiding this comment.
Feels like an oversight to have to rebuild region here, given it was only created a couple of lines above. Is this information really not known prior to MPIRegion construction?
Additionally, is it worth having a mapper: frozendict({r: r.pfields for r in self.regions})?
| f'compute{key}', | ||
| hs.body, | ||
| hs.arguments, | ||
| Region(region.name, region.pname, region.arguments), |
There was a problem hiding this comment.
This isn't just a rebuild? Why is a new Region needed here?
| f'compute{key}', | ||
| iet, | ||
| hs.arguments, | ||
| Region(region.name, region.pname, region.arguments), |
There was a problem hiding this comment.
Same again, could this go inside make_efunc?
There was a problem hiding this comment.
yr right, fixed
| with switchconfig(mpi='basic'): | ||
| reference = Operator(eq0, name='SubDomainRegionReference') | ||
| op = Operator(eq1, name='SubDomainRegionArguments', | ||
| opt=('advanced', {'blockinner': True})) |
There was a problem hiding this comment.
Compare to a serial run or an exact solution (e.g. a sinusoid). However, the allclose seems a little superfluous to the test
| eqs = [Eq(u.forward, u + 1), | ||
| Eq(state, state + 1, subdomain=boundary, | ||
| implicit_dims=[grid.time_dim])] | ||
| op = Operator(eqs, platform='nvidiaX', language='openacc', |
There was a problem hiding this comment.
Feels like an odd place to set this? Shouldn't this be handled by skipifs, given this test runs the operator?
|
|
||
| eq = Eq(u.forward, u + .01*u.laplace + .125) | ||
|
|
||
| op = Operator(eq, name='RegionParameters', |
There was a problem hiding this comment.
Ultra-nitpick: Pointless to name this operator
| def test_iso_ac(self, mode): | ||
| TestOperator().iso_acoustic(opt='advanced') | ||
|
|
||
| @pytest.mark.skipif(configuration['language'] != 'openacc', reason='requires OpenACC') |
There was a problem hiding this comment.
Do we not have a specific skipif in conftest.py?
There was a problem hiding this comment.
no we don't , but adding it
4bf6f45 to
198ab6c
Compare
| return f'{self.name}({printer.doprint(self.initvalue)})' | ||
|
|
||
| _ccode = _sympystr | ||
| _cxxcode = _sympystr |
There was a problem hiding this comment.
That's not how we handle this, that should already be the default for any printer to default to sympystr
198ab6c to
2716bd8
Compare
Triggered via CPML + MPI