mpi: Fixup code generation for Bundles#2581
Conversation
dbd4524 to
5b59cec
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2581 +/- ##
===========================================
- Coverage 91.96% 45.91% -46.05%
===========================================
Files 244 245 +1
Lines 47797 47974 +177
Branches 4207 4219 +12
===========================================
- Hits 43957 22029 -21928
- Misses 3165 25026 +21861
- Partials 675 919 +244
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| try: | ||
| name = "bag_%s" % "".join(f.name for f in candidates) | ||
| bag = Bag(name=name, components=candidates) | ||
| name = "bag_%s" % "".join(f.name for f in components) |
There was a problem hiding this comment.
Fstring? Might be a rare occasion where it's less neat tbh
| # Vector types | ||
| return len(dtype) | ||
| dlen = len(dtype) | ||
| if 'padding0' in dtype.fields: |
There was a problem hiding this comment.
Why do you need to search for this hardcoded string? Looks a bit hacky
9dbaf1f to
4a959f6
Compare
462e604 to
f3d7aca
Compare
| return printAST(self) | ||
|
|
||
| @property | ||
| def view_cir(self): |
There was a problem hiding this comment.
This is like a prettier print I guess
| ) | ||
|
|
||
| @property | ||
| @cached_property |
There was a problem hiding this comment.
What is the motivation for this?
There was a problem hiding this comment.
It went from simply being an alias for an attribute of an attribute, to having internal logic etc
| except ValueError: | ||
| for i in candidates: | ||
| for i in components: | ||
| name = "bag_%s" % i.name |
| @@ -363,10 +372,17 @@ def _make_copy(self, f, hse, key, swap=False): | |||
| else: | |||
| swap = lambda i, j: (j, i) | |||
| name = 'scatter%s' % key | |||
| bfmap = map_buffered_functions(clusters, key) | ||
|
|
||
| # Sort for deterministic code generation | ||
| bfmap = {i: bfmap[i] for i in sorted(bfmap, key=lambda i: i.name)} |
There was a problem hiding this comment.
Should this sorting go into map_buffered_functions instead?
| # NOTE: the `arity` is calculated such as `sizeof(float3)/sizeof(float)` | ||
| # for portability reasons (since we don't know the size of compound | ||
| # types a priori) | ||
| arity_param = Symbol(name='arity', dtype=size_t) |
There was a problem hiding this comment.
I guess you can't have more than one of these per kernel, so no need to go through the symbol registry?
| """ | ||
| decl = Definition(obj) | ||
|
|
||
| # NOTE: the `arity` is calculated such as `sizeof(float3)/sizeof(float)` |
There was a problem hiding this comment.
This code is largely identical to that in _alloc_mapped_array_on_high_bw_mem. Would it be worth pulling this out into a utility function?
| call1 = call._rebuild(arguments=args) | ||
| efunc1 = Transformer({call: call1}).visit(efunc) | ||
|
|
||
| #TODO Propagate index through call stack until haloupdate... |
There was a problem hiding this comment.
Nitpick: probably only temp comments, but not Pep8 compliant
| efuncs = update_call_stack(call, efuncs, _filter, cascade=True) | ||
|
|
||
| # Store the new Callables | ||
| efuncs.up |
|
closing this, and reopening soon from another branch |
All tests are in PRO ... because that's the only place where we generate Bundles