Permit implicit reshaping in get_callee()#3442
Conversation
|
@sergisiso This probably looks like it'd be best for you to review (as you may know more about if/why we may not support this at current). If I'm wrong and you're too busy then let me know and I'm also happy to have a look. I'm not sure if/how this could affect inlining (if it would at all, but inlining functions with this behaviour would be bad)? |
Exactly - this functionality was (I think) driven by the inlining use case and therefore I think that's the reason I wrote it this way. If it would be useful to have the option to permit re-shaped arguments then I don't have a problem with that, as long as it can still be refused when trying to inline. |
|
Hi @arporter and @LonelyCat124, I believe that Indeed, this feels like a much better place for the rank check. I noticed it because I had to tweak one of the inlining tests (see "Files Changed") which, after my proposed change, hits a different (and clearer) error message about Can you think of any other blockers for this PR? Unfortunately, implicit reshaping does crop up in important places in UKCA, and PSyclone not resolving the call is blocking some of my analyses. Edit: I may be able to update UKCA to avoid implicit reshaping in some places, but I am still thinking that the PR could be an improvement -- it is just allowing something that Fortran allows. |
|
Sorry for not replying earlier, in short I do agree this is an improvement specially if it unblocks work on UKCA. I got distracted because I was considering:
But none of these need to be fixed now for this PR to progress. |
arporter
left a comment
There was a problem hiding this comment.
Thanks very much Matthew. I've done a first pass and there are just comments and docstrings to tweak. Once you've fixed the conflict and the tests, I'll check the integration tests too.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3442 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 393 393
Lines 55065 55067 +2
=========================================
+ Hits 55065 55067 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks @arporter. I've brought it up-to-date with master and made the suggested changes. |
|
Changes all look good now, thanks very much. Just waiting on the ITs... |
arporter
left a comment
There was a problem hiding this comment.
ITs were all green. This is good to go.
Currently,
get_callee()requires the ranks of an array argument to match at the caller and callee but this is not strictly necessary in Fortran due to implicit reshaping (which occurs in UKCA). This PR requires the ranks to match only if:GenericInterfaceSymbolrather than aRoutineSymbol, orI appreciate that implicit reshaping may not be considered good practice - perhaps it is a deliberate decision to ignore it? If not, perhaps this PR is useful.