PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

Classes to be split from dynamo0p3.py

Open mo-lottieturner opened this issue 2 years ago • 2 comments

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 avatar Jul 27 '23 14:07 mo-lottieturner

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 avatar Jul 27 '23 15:07 mo-lottieturner

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

mo-lottieturner avatar Aug 14 '23 13:08 mo-lottieturner