Skip to content
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

Classes to be split from dynamo0p3.py #2235

Open
mo-lottieturner opened this issue Jul 27, 2023 · 2 comments
Open

Classes to be split from dynamo0p3.py #2235

mo-lottieturner opened this issue Jul 27, 2023 · 2 comments
Assignees
Labels
LFRic Issue relates to the LFRic domain

Comments

@mo-lottieturner
Copy link
Collaborator

Umbrella issue for the splitting of dynamo0p3.py into separate files in domain/lfric/. Smaller, more detailed issues to be made and linked back to this issue - PRs should only move one class out each.

LFRicLoopBounds: appears in domain/lfric/lfric_invoke.py and tests/domain/lfric/lfric_loop_bounds_test.py, no name change needed - uses LFRicCollection, so unlikely to have a circular dependency

Others unlikely to have circular dependencies:

LFRicScalarArgs: appears in two files and two test files (grep -rwn LFRicScalarArgs)
DynStencil: only appears in dynamo0p3.py
DynamoInvokes: three files inc dynamo0p3.py

in pylint: disable=import-outside-toplevel markers

DynReferenceElement
DynStencils - lots of places to change this, but only 7 different files
DynCMAOperators
LFRicMeshProperties
DynBasisFunctions
DynLoop
FSDescriptors, DynKernelArguments
DynInvokeSchedule
LFRicBuiltIn
(LFRicScalarArgs, DynFunctionSpaces, DynDofmaps, LFRicFields, DynLMAOperators,
DynMeshes, DynBoundaryConditions, DynProxies, LFRicRunTimeChecks,
DynCellIterators, DynReferenceElement, LFRicLoopBounds, DynGlobalSum)

@mo-lottieturner
Copy link
Collaborator Author

mo-lottieturner commented Jul 27, 2023

Table of each class in dynamo0p3.py and info relating to ease of splitting them

Class rename called under a disable=import-outside-toplevel number of files test file situation actioned
DynFuncDescriptor03 yes 4 split
RefElementMetaData ? 3 move
MeshProperty ? 2 good
MeshPropertiesMetaData ? 2
DynKernMetadata yes 29? #2392
DynamoPSy yes 9 move? #2460
DynamoInvokes yes 5 #2268
DynStencils yes yes - 15 7 good #2410
LFRicMeshProperties yes - 4 6 good
DynReferenceElement yes yes - 3 5 move
DynDofmaps yes yes - 2 4 #2455
DynFunctionSpaces yes yes - 2 3
LFRicFields yes - 2 5 good #2272
LFRicRunTimeChecks yes - 1 2 #2284
DynProxies yes yes - 1 3 split
DynCellIterators yes yes - 2 4 split
LFRicLoopBounds yes - 1 3 good #2245
LFRicScalarArgs yes - 2 5 good #2263
DynLMAOperators yes yes - 2 3
DynCMAOperators yes yes - 3 4
DynMeshes yes yes - 1 3 move
DynInterGrid yes 1
DynBasisFunctions yes yes - 4 6 move
DynBoundaryConditions yes yes - 2 4 split
DynInvokeSchedule yes yes - 2 11 #2451
DynGlobalSum yes yes - 1 5 split?
DynLFRicHaloExchange 12 move + l6045 untested #2279
DynLFRicHaloExchangeStart 6
DynLFRicHaloExchangeEnd 3
HaloDepth ? 2
HaloWriteAccess ? 1
HaloReadAccess ? 3
DynLoop yes yes - 3 22 good #2261
FSDescriptor ? 3
FSDescriptors ? yes - 2 4 split
DynStencil LFRicArgStencil 1 #2265
DynKernelArguments yes yes - 3 8 split + l7995 untested
DynKernelArgument yes 22 split + l8196 untested
DynACCEnterDataDirective yes 3 split

@mo-lottieturner
Copy link
Collaborator Author

mo-lottieturner commented Aug 14, 2023

Keeping track of circular dependencies to untangle:

Circle one

  • src/psyclone/domain/lfric/lfric_collection.py: from psyclone.domain.lfric import (LFRicSymbolTable, LFRicInvoke,
  • src/psyclone/domain/lfric/lfric_loop_bounds.py from psyclone.domain.lfric import LFRicCollection
  • src/psyclone/domain/lfric/lfric_invoke.py from psyclone.domain.lfric import LFRicLoopBounds

Circle Two

  • LFRicRunTimeChecks requires LFRicCollection.
  • LFRicCollection requires LFRicInvoke.
  • LFRicInvoke requires LFRicRunTimeChecks.

init.py

RTC needs to be imported after Collection and before Constants
Collection needs to be imported after Constants
Collection and Constants don't need RTC
Therefore RTC has been imported in LFRicInvoke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LFRic Issue relates to the LFRic domain
Projects
None yet
Development

No branches or pull requests

2 participants