-
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
Fix bugs in handling of Fortran types (closes #2237) #2255
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2255 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 344 343 -1
Lines 45931 46011 +80
=======================================
+ Hits 45860 45940 +80
Misses 71 71
☔ View full report in Codecov by Sentry. |
Ready for first review from @arporter or @sergisiso |
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.
@rupertford I made just minor suggestions and I think this potentially fixes (represents as UnknownFortranType) some abstract types in Numa3d and Nemo.
There is a subtle issue when we have code that looks for all the symbols "used" in a region, e.g. the two inline transformations
(src/psyclone/domain/common/transformations/kernel_module_inline_trans.py line 184) and (src/psyclone/psyir/transformations/inline_trans.py line 678) and maybe others.
As the initialisation expression could have symbols that are not declared in the same symbol table and these methods will miss to check if the symbol can be safely inlined.
However, these ad-hoc implementations are already very error-prone and I would like to centralise this logic in a single place (maybe a symbol_table utility or the self.reference_accesses itself). So I will create a separate issue for it.
Ready for next review from @sergisiso, but this PR is to check that the path I have taken is the right one before I fix tests and tidy up. |
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.
@rupertford Unfortunately the symbol resolution for NEMO is not quite working yet, but we are getting closer. Can you look at the following issues.
(I am fine with leaving the debug_string for the inlining as it is, and discuss it in its own issue)
src/psyclone/domain/common/transformations/kernel_module_inline_trans.py
Outdated
Show resolved
Hide resolved
Ah the PR that keeps giving. I'll take a look at the problems. |
…nes when resolving imports
Ready for next review from @sergisiso |
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.
@rupertford Thanks for addressing all comments. This PR is now passing the integration tests without degrading the performance and all remaining discussions are addressed by other issues marked as TODOs, so it can proceed to be merge.
I fixed small remaining pycodestyle, but all other tests pass, patch codecov is complete and the docs build without new issues.
I will wait for #2269 to be merged first |
When parsing Fortran types (structures) the
extends
clause can be discarded and initial values provided for entries in the type can also be discarded. This PR fixes these two problems.