-
Notifications
You must be signed in to change notification settings - Fork 257
mpi: fix allreduce iteration space #2662
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 4 commits
2cf9dca
542f7a6
c883ff0
5632558
b99909a
f7edc62
ff1ff76
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 |
|---|---|---|
|
|
@@ -407,7 +407,10 @@ def reads(self): | |
| @cached_property | ||
| def write(self): | ||
| """The Function written by the Expression.""" | ||
| return self.expr.lhs.base.function | ||
| try: | ||
|
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. yeah I think we can remove it for now until a PR ships it along with a test |
||
| return self.expr.rhs.writes[0] | ||
| except (AttributeError, IndexError): | ||
| return self.expr.lhs.base.function | ||
|
|
||
| @cached_property | ||
| def dimensions(self): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2014,6 +2014,24 @@ def test_merge_smart_if_within_conditional(self, mode): | |
| for n in FindNodes(Conditional).visit(op1): | ||
| assert len(FindNodes(HaloUpdateCall).visit(n)) == 0 | ||
|
|
||
| @pytest.mark.parallel(mode=2) | ||
| def test_allreduce_time(self, mode): | ||
| space_order = 8 | ||
| nx, ny = 11, 11 | ||
|
|
||
| grid = Grid(shape=(nx, ny)) | ||
| tt = grid.time_dim | ||
| nt = 10 | ||
|
|
||
| ux = TimeFunction(name="ux", grid=grid, time_order=1, space_order=space_order) | ||
| g = TimeFunction(name="g", grid=grid, dimensions=(tt, ), shape=(nt,)) | ||
|
|
||
| op = Operator([Eq(ux.forward, ux + tt), Inc(g, ux)], name="Op") | ||
| assert_structure(op, ['t,x,y', 't'], 'txy') | ||
|
|
||
| op.apply(time_m=0, time_M=nt-1) | ||
| assert np.isclose(np.max(g.data), 4356.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. Super nitpick: you could set the dtype to int on the timefunctions and then just check for equality here |
||
|
|
||
|
|
||
| class TestOperatorAdvanced: | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.