Create separate ModuleWrapTransformation from DependencyTransformation #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The DependencyTransformation is responsible for an increasing number of workarounds and special casing in the scheduler traversals. Part of this has been identified to be related to the fact that two concepts are mixed together here:
This PR splits the two into separate transformation passes but tries to be minimally invasive otherwise. There may undoubtedly be capacity in rewriting some of the transformation logic itself but that can now be a separate change.
The original
strict
mode behaviour is retained by plainly calling the DependencyTransformation, themodule
mode is recovered by applying the new ModuleWrapTransformation before the DependencyTransformation.A caveat is the fact that the current scheduler items loose the ability to identify inline calls as targets after the module wrapping. This is because these links are only identified for functions that are declared via explicit interfaces, and after the module wrap these are regular fortran imports via
use
. Previously this wasn't a problem because the wrapping and renaming happened in the same step, and afterwards in the transformation pipeline this relation was no longer required.To retain this piece of information across the now two independent transformation passes I converted the targets property to a cached property. This seems to be ok for all tests and regression tests but needs careful verification on ecphys! It's important to note that this is only a temporary measure because the scheduler rewrite will introduce inline call dependencies independently from an interface declaration.