Closed mlange05 closed 5 months ago
Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/276/index.html
Clean with EC-physics regression.
Attention: Patch coverage is 97.81022%
with 3 lines
in your changes are missing coverage. Please review.
Project coverage is 92.89%. Comparing base (
a594b44
) to head (da9cf28
).
Files | Patch % | Lines |
---|---|---|
loki/transform/transform_remove_code.py | 96.80% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @reuterbal just a quick heads-up: there was some cross-fire between PR #271 and this one, causing a test failure for scheduler / pipeline configs. I've rebased over latest main and adjusted accordingly. Only the top two commits should be new. Hope this works now.
Many thanks for catching the rebase fall-out! As discussed offline, I've done a little touch-up on the docstrings, otherwise this should be good to go!
This PR combines two closely related features:
Transformation
for inclusion in more complex pipelines.The new pragma-based region removal will pretty much do as it says: Upon encountering a region marked with
!$loki remove
/!$loki end remove
it will simply remove the entire code region.The new
loki.transfom.transform_remove_code
basically includes the previous dead code elimination (renamed), and combines it with the new region removal and a re-write of theRemoveCallsTransformation
. The latter is now a as a singleTransformer
with a wrapper routine that allows it to be applied toSubroutine
objects. All three utilities are then provided as a singleRemoveCodeTransformation
for use with theScheduler
and batch-processing engine.Since the wrapper routines for these utilities would otherwise create name clashes with the respective flags of the overarching
Transformation
, we adopt thedo_remove_xxx
naming convention, as discussed offline.In some more detail:
loki.transform.transform_dead_code
=>loki.transform.transform_remove_code
RemoveMarkedRegionsTransformer
anddo_remove_marked_regions
wrapperRemvoeCallsTransformer
anddo_remove_calls
wrappereleminate_dead_code
toRemoveDeadCodeTransformer
anddo_remove_dead_code
RemoveCodeTransformation
in loki-transform and remove the oldRemoveCallsTransformation
fromtransformations
transformations.utility_rouines
=>transformations.drhook
, as it's the last custom utility left in there.