-
Notifications
You must be signed in to change notification settings - Fork 30
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
(Towards #2156) Changes to routine_copy and fortran backend for elemental and impure support #2566
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2566 +/- ##
=======================================
Coverage 99.86% 99.86%
=======================================
Files 354 354
Lines 48330 48411 +81
=======================================
+ Hits 48267 48348 +81
Misses 63 63 ☔ View full report in Codecov by Sentry. |
I've had to change something in fparser2.py now as well - the default behaviour is now that the purity of a subroutine is None (i.e. unknown) unless it is specified. This is required as elemental implies pure unless specified, however an input of We could also adapt this to have elemental set is_pure=True unless is_pure is already False, but I will leave that to the reviewer. @arporter this is ready for review now - may be helpful to have before Nemo party but I'm not sure if its sufficient to fix their issues. |
Also I realise that this doesn't technically fix the stuff for the issue 2156 but just andy's comments within. |
@arporter @sergisiso Should we also ask to test this branch with NEMO before the NEMO party? |
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.
Thanks Aidan, this looks good to me.
Just a couple of very minor things to tidy up. I can't yet run the integration tests as the python modules on the runner need fixing so that will have to wait until next time.
Ref guide still builds fine.
@arporter changes done so should be ready for another look once the runner on glados is up and running again. |
Thanks @LonelyCat124 to implement this, looking at NEMO upstream it seems that they all are elemental functions, I think it will work with your implementation but it would be good to add some tests with functions to make sure it all goes right(frontend-attribute-backend). |
I'm guessing there's some return type on these functions too? It works if I use Edit: Never mind, I made it work without the return type declared on the function now. Tests added - ready for another look |
In nemo functions the type is in the declarations (with the same name as the function), not the function line:
|
Yeah - I put that in the tests and it works. PSyclone does just create a codeblock if I have |
Also - should I do something on xfailing tests that makes the test fail if the xfail condition isn't met? I feel like those tests should either xfail or fail - if they succeed we should have a proper test for them (I just realised while playing around with #2201 that if I make the xfail test work it doesn't report anything wrong) - adding an else in the test fails coverage. |
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.
All requested changes have been made (thanks). I'll fire off the integration tests once more.
Actually, I can't run the integration tests until #2571 is on.
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.
Thanks Aidan.
A comment will really help me understand what your new addition to routine.py
is doing. Aside from that there's just a bit of tidying to do.
I've fired off the integration tests as they are now working again for NEMO and compilation.
Ref. guide still builds fine.
Just a note to record that the NEMO and compilation integration tests were fine for this PR. (LFRic tests are currently not working.) |
Ready for another look now, let me know if you think the comment is sufficient. |
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.
All requested changes have been made. Integration tests are all green.
Will proceed to merge.
A few small changes required to make the PSyIR layer (mostly the backends) not lose information on pure and elemental subroutines.
This might solve some of the NEMO issues reported, but only if the subroutines are contained within modules.