-
Notifications
You must be signed in to change notification settings - Fork 29
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
(Closes #2716) Add support for module-inlining calls to polymorphic kernels/routines #2732
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 #2732 +/- ##
========================================
Coverage 99.88% 99.88%
========================================
Files 357 357
Lines 49652 49763 +111
========================================
+ Hits 49596 49707 +111
Misses 56 56 ☔ View full report in Codecov by Sentry. |
As well as addressing the coverage, I need to extend the LFRic integration tests to use this new functionality. |
Added the KernelModuleInlineTrans back into the LFRic transformation script and get a crash when trying to add the interface symbol into the symbol table. |
|
The problem is that the invoke subroutine is still importing the kernel interface, even though it has been module inlined: SUBROUTINE invoke_1(scalar_r_phys, a, istp)
USE mixed_kernel_mod, ONLY: mixed_code EDIT: I think this is correct. We've only module-inlined the mixed_kernel for |
I'm beginning to think that this is a compiler bug. If I alter the second invoke so that it calls a specific implementation of the kernel (e.g. mixed_code_64) then it compiles fine. |
This is ready for a first review. It's quite big but can wait until 3.0 is out of the door. Probably needs to be reviewed by @sergisiso. |
In experimenting with this branch, I discovered a bug: the routines that a PUBLIC Interface maps to may themselves be declared PRIVATE in their containing module! Unfortunately, in what I've written I've assumed they must be public. |
Trying this updated branch with LFRic (and my enhanced global.py) I now get:
where Also get
This is possibly because that module contains an unsupported form of interface definitions: INTERFACE
SUBROUTINE chi2xyz_interface(chi_1, chi_2, chi_3, panel_id, x, y, z)
IMPORT :: r_def, i_def
IMPLICIT NONE
INTEGER(KIND = i_def), INTENT(IN) :: panel_id
REAL(KIND = r_def), INTENT(IN) :: chi_1, chi_2, chi_3
REAL(KIND = r_def), INTENT(OUT) :: x, y, z
END SUBROUTINE chi2xyz_interface
END INTERFACE |
Attempt to do recursive inlining:
but ...well, ish. It's a bit messy because there's no clean way to spot all the Symbols a bit of code uses and I don't want to duplicate what |
…d routine and precision symbols
No description provided.