-
Notifications
You must be signed in to change notification settings - Fork 28
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
#2711 DoF Kernel Code Generation #2712
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2712 +/- ##
=======================================
Coverage 99.86% 99.86%
=======================================
Files 354 354
Lines 48963 48980 +17
=======================================
+ Hits 48899 48916 +17
Misses 64 64 ☔ View full report in Codecov by Sentry. |
… 2711-dof-kernels-code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good first step @oakleybrunt, thank you. You'll see that I think we can do away with the new property you've added and thus shorten the code and tests somewhat.
In reading the Developer Guide, I also discovered that it needs updating - please see https://psyclone-dev.readthedocs.io/en/latest/APIs.html#loop-iterators and update it slightly.
I'll launch the integration tests next time round but I don't anticipate any issues.
I think the sub-class |
That is exactly what's happening. Does this mean that the |
It probably means that you need to override this method in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking very nice now Oakley, thanks. Well done for minimising the code changes.
Some of the new methods you've added need explicit tests. (We have a rule that the test battery associated with a given source file should give 100% coverage of that file. In some places we're still working towards this ambition but all new code should have appropriate tests added.)
I've also realised that we probably need more 'functional' tests as there's lots that can go wrong when adding an important new concept like this. Please could you add a test that Dynamo0p3RedundantComputationTrans
(https://psyclone-ref.readthedocs.io/en/latest/_static/html/classpsyclone_1_1transformations_1_1Dynamo0p3RedundantComputationTrans.html) works when applied to one of the new dof kernels.
You'll need to check that the halo-exchanges are to the correct depth.
Please could you also construct a more complex test invoke that mixes kernels that operate on cell-columns, user kernels that operate on dofs and, finally, builtin kernels.
You could base this off e.g. test_files/dynamo0p3/3.1_multi_functions_multi_invokes.f90
but you needn't bother with multiple invokes.
In the meantime, I've also fired off the integration tests but it's going to take a while for them to run.
@@ -93,6 +93,27 @@ def cell_position(self, var_accesses=None): | |||
_, ref = self.cell_ref_name(var_accesses) | |||
self.append(ref.symbol.name) | |||
|
|||
def field(self, arg, var_accesses=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for this method to tests/domain/lfric/kern_call_acc_arg_list_test.py
@@ -557,6 +557,19 @@ def base_name(self): | |||
''' | |||
return self._base_name | |||
|
|||
@property | |||
def undf_name(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for this method in tests/domain/lfric/lfric_kern_test.py
.
assert 'undf' in test_fs._var_list | ||
|
||
|
||
def test_compiles(tmpdir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test can go now.
assert LFRicBuild(tmpdir).code_compiles(psy) | ||
|
||
|
||
def test_undf_initialisation(tmpdir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test can probably go now unless it is covering something specific to dof kernels.
" loop0_stop = f1_proxy%vspace%get_last_dof_owned()" | ||
) | ||
|
||
# Shared memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annexed only has any effect if distributed-memory is enabled so you can simplify this to elif not dist_mem:
As I am working on making the dof kernel ( |
Closes #2711 which has a checklist of actions taken