diff --git a/doc/user_guide/dynamo0p3_topclasses.dot b/doc/user_guide/dynamo0p3_topclasses.dot index 67700919c4..9d7c5057d5 100644 --- a/doc/user_guide/dynamo0p3_topclasses.dot +++ b/doc/user_guide/dynamo0p3_topclasses.dot @@ -3,7 +3,7 @@ charset="utf-8" rankdir=BT "20" [label="{LFRicInvoke|\l|arg_for_funcspace()\lfield_on_space()\lgen_code()\lis_coloured()\lunique_fss()\lunique_proxy_declarations()\l}", shape="record"]; -"21" [label="{DynInvokeSchedule|\l|view()\l}", shape="record"]; +"21" [label="{LFRicInvokeSchedule|\l|view()\l}", shape="record"]; "35" [label="{DynamoInvokes|\l|}", shape="record"]; "36" [label="{DynamoPSy|\l|}", shape="record"]; "45" [label="{Invoke|\l|first_access()\lgen()\lgen_code()\lunique_declarations()\lunique_declns_by_intent()\l}", shape="record", style=filled, fillcolor="antiquewhite"]; diff --git a/doc/user_guide/dynamo0p3_topclasses.svg b/doc/user_guide/dynamo0p3_topclasses.svg index dfa07f7cbe..5dbc989db4 100644 --- a/doc/user_guide/dynamo0p3_topclasses.svg +++ b/doc/user_guide/dynamo0p3_topclasses.svg @@ -62,7 +62,7 @@ 21 -DynInvokeSchedule +LFRicInvokeSchedule view() diff --git a/src/psyclone/domain/lfric/lfric_builtins.py b/src/psyclone/domain/lfric/lfric_builtins.py index a5038813b4..381e209a8c 100644 --- a/src/psyclone/domain/lfric/lfric_builtins.py +++ b/src/psyclone/domain/lfric/lfric_builtins.py @@ -108,7 +108,7 @@ def create(call, parent=None): :type call: :py:class:`psyclone.parse.algorithm.BuiltInCall` :param parent: the schedule instance to which the built-in call \ belongs. - :type parent: :py:class:`psyclone.dynamo0p3.DynInvokeSchedule` + :type parent: :py:class:`psyclone.dynamo0p3.LFRicInvokeSchedule` :raises ParseError: if the name of the function being called is \ not a recognised built-in. diff --git a/src/psyclone/domain/lfric/lfric_invoke.py b/src/psyclone/domain/lfric/lfric_invoke.py index 70b0bf3f52..b146162010 100644 --- a/src/psyclone/domain/lfric/lfric_invoke.py +++ b/src/psyclone/domain/lfric/lfric_invoke.py @@ -75,15 +75,15 @@ def __init__(self, alg_invocation, idx, invokes): return # Import here to avoid circular dependency # pylint: disable=import-outside-toplevel - from psyclone.dynamo0p3 import DynInvokeSchedule - self._schedule = DynInvokeSchedule('name', None) # for pyreverse + from psyclone.dynamo0p3 import LFRicInvokeSchedule + self._schedule = LFRicInvokeSchedule('name', None) # for pyreverse reserved_names_list = [] const = LFRicConstants() reserved_names_list.extend(const.STENCIL_MAPPING.values()) reserved_names_list.extend(const.VALID_STENCIL_DIRECTIONS) reserved_names_list.extend(["omp_get_thread_num", "omp_get_max_threads"]) - Invoke.__init__(self, alg_invocation, idx, DynInvokeSchedule, + Invoke.__init__(self, alg_invocation, idx, LFRicInvokeSchedule, invokes, reserved_names=reserved_names_list) # The base class works out the algorithm code's unique argument diff --git a/src/psyclone/domain/lfric/lfric_loop.py b/src/psyclone/domain/lfric/lfric_loop.py index 794a0dc98b..c4a17b4ed9 100644 --- a/src/psyclone/domain/lfric/lfric_loop.py +++ b/src/psyclone/domain/lfric/lfric_loop.py @@ -788,7 +788,7 @@ def stop_expr(self): if self.upper_bound_name in const.HALO_ACCESS_LOOP_BOUNDS: if self._upper_bound_halo_depth: # TODO: #696 Add kind (precision) once the - # DynInvokeSchedule constructor has been extended to + # LFRicInvokeSchedule constructor has been extended to # create the necessary symbols. halo_depth = Literal(str(self._upper_bound_halo_depth), INTEGER_TYPE) diff --git a/src/psyclone/dynamo0p3.py b/src/psyclone/dynamo0p3.py index f6552b3e82..2f4a259799 100644 --- a/src/psyclone/dynamo0p3.py +++ b/src/psyclone/dynamo0p3.py @@ -3441,7 +3441,7 @@ class DynBasisFunctions(LFRicCollection): :param node: either the schedule of an Invoke or a single Kernel object \ for which to extract information on all required \ basis/diff-basis functions. - :type node: :py:class:`psyclone.dynamo0p3.DynInvokeSchedule` or \ + :type node: :py:class:`psyclone.dynamo0p3.LFRicInvokeSchedule` or \ :py:class:`psyclone.domain.lfric.LFRicKern` :raises InternalError: if a call has an unrecognised evaluator shape. @@ -4438,7 +4438,7 @@ def initialise(self, parent): "get_boundary_dofs()"]))) -class DynInvokeSchedule(InvokeSchedule): +class LFRicInvokeSchedule(InvokeSchedule): ''' The Dynamo specific InvokeSchedule sub-class. This passes the Dynamo- specific factories for creating kernel and infrastructure calls to the base class so it creates the ones we require. @@ -7010,7 +7010,7 @@ def data_on_device(self, _): 'DynInterGrid', 'DynBasisFunctions', 'DynBoundaryConditions', - 'DynInvokeSchedule', + 'LFRicInvokeSchedule', 'DynGlobalSum', 'LFRicHaloExchange', 'LFRicHaloExchangeStart', diff --git a/src/psyclone/psyir/nodes/acc_directives.py b/src/psyclone/psyir/nodes/acc_directives.py index a92536c638..cec8878467 100644 --- a/src/psyclone/psyir/nodes/acc_directives.py +++ b/src/psyclone/psyir/nodes/acc_directives.py @@ -121,11 +121,11 @@ def signatures(self): ''' # pylint: disable=import-outside-toplevel - from psyclone.dynamo0p3 import DynInvokeSchedule + from psyclone.dynamo0p3 import LFRicInvokeSchedule from psyclone.gocean1p0 import GOInvokeSchedule from psyclone.psyir.tools import DependencyTools - if self.ancestor((DynInvokeSchedule, GOInvokeSchedule)): + if self.ancestor((LFRicInvokeSchedule, GOInvokeSchedule)): # Look-up the kernels that are children of this node sig_set = set() for call in self.kernels(): diff --git a/src/psyclone/tests/domain/lfric/dyn_invoke_schedule_test.py b/src/psyclone/tests/domain/lfric/dyn_invoke_schedule_test.py index 14867749a6..936477bb6f 100644 --- a/src/psyclone/tests/domain/lfric/dyn_invoke_schedule_test.py +++ b/src/psyclone/tests/domain/lfric/dyn_invoke_schedule_test.py @@ -33,11 +33,11 @@ # ----------------------------------------------------------------------------- # Author: A. R. Porter, STFC Daresbury Lab -''' This module contains pytest tests for the DynInvokeSchedule class. ''' +''' This module contains pytest tests for the LFRicInvokeSchedule class. ''' import os from psyclone.domain.lfric import LFRicSymbolTable -from psyclone.dynamo0p3 import DynInvokeSchedule +from psyclone.dynamo0p3 import LFRicInvokeSchedule from psyclone.parse.algorithm import parse from psyclone.psyir.nodes import Container @@ -49,15 +49,15 @@ def test_dyninvsched_parent(): - ''' Check the setting of the parent of a DynInvokeSchedule. ''' + ''' Check the setting of the parent of a LFRicInvokeSchedule. ''' _, invoke_info = parse(os.path.join(BASE_PATH, "1.0.1_single_named_invoke.f90"), api=TEST_API) kcalls = invoke_info.calls[0].kcalls # With no parent specified - dsched = DynInvokeSchedule("my_sched", kcalls) + dsched = LFRicInvokeSchedule("my_sched", kcalls) assert dsched.parent is None # With a parent fake_parent = Container("my_mod", symbol_table=LFRicSymbolTable()) - dsched2 = DynInvokeSchedule("my_sched", kcalls, parent=fake_parent) + dsched2 = LFRicInvokeSchedule("my_sched", kcalls, parent=fake_parent) assert dsched2.parent is fake_parent diff --git a/src/psyclone/tests/domain/lfric/transformations/dynamo0p3_transformations_test.py b/src/psyclone/tests/domain/lfric/transformations/dynamo0p3_transformations_test.py index d88ed0a54d..c4907fd2d2 100644 --- a/src/psyclone/tests/domain/lfric/transformations/dynamo0p3_transformations_test.py +++ b/src/psyclone/tests/domain/lfric/transformations/dynamo0p3_transformations_test.py @@ -460,7 +460,7 @@ def test_colouring_not_a_loop(dist_mem): with pytest.raises(TransformationError) as excinfo: ctrans.apply(schedule) assert ("Target of Dynamo0p3ColourTrans transformation must be a " - "sub-class of Loop but got 'DynInvokeSchedule'" in + "sub-class of Loop but got 'LFRicInvokeSchedule'" in str(excinfo.value)) @@ -502,7 +502,7 @@ def test_omp_not_a_loop(dist_mem): otrans.apply(schedule) assert ("Target of Dynamo0p3OMPLoopTrans transformation must be a sub-" - "class of Loop but got 'DynInvokeSchedule'" in str(excinfo.value)) + "class of Loop but got 'LFRicInvokeSchedule'" in str(excinfo.value)) def test_omp_parallel_not_a_loop(dist_mem): @@ -519,7 +519,7 @@ def test_omp_parallel_not_a_loop(dist_mem): with pytest.raises(TransformationError) as excinfo: otrans.apply(schedule) assert ("Error in DynamoOMPParallelLoopTrans transformation. The " - "supplied node must be a LFRicLoop but got 'DynInvokeSchedule'" + "supplied node must be a LFRicLoop but got 'LFRicInvokeSchedule'" in str(excinfo.value)) @@ -5310,7 +5310,7 @@ def test_rc_wrong_parent(monkeypatch): # Apply redundant computation to the loop with pytest.raises(TransformationError) as excinfo: rc_trans.apply(schedule.children[4], {"depth": 1}) - assert ("the parent of the supplied loop must be the DynInvokeSchedule, " + assert ("the parent of the supplied loop must be the LFRicInvokeSchedule, " "or a Loop") in str(excinfo.value) @@ -5350,7 +5350,7 @@ def test_rc_parent_loop_colour(monkeypatch): with pytest.raises(TransformationError) as excinfo: rc_trans.apply(schedule.children[4].loop_body[0], {"depth": 1}) assert ("if the parent of the supplied Loop is also a Loop then the " - "parent's parent must be the DynInvokeSchedule" + "parent's parent must be the LFRicInvokeSchedule" in str(excinfo.value)) # Make the outermost loop iterate over cells (it should be diff --git a/src/psyclone/tests/domain/lfric/transformations/lfric_haloex_test.py b/src/psyclone/tests/domain/lfric/transformations/lfric_haloex_test.py index 0181845ac5..980b1f426d 100644 --- a/src/psyclone/tests/domain/lfric/transformations/lfric_haloex_test.py +++ b/src/psyclone/tests/domain/lfric/transformations/lfric_haloex_test.py @@ -93,7 +93,7 @@ def check_schedule(schedule): write-to-gh_inc dependence. :param schedule: a dynamo0.3 API schedule object - :type schedule: :py:class:`psyclone.dynamo0p3.DynInvokeSchedule`. + :type schedule: :py:class:`psyclone.dynamo0p3.LFRicInvokeSchedule`. ''' assert len(schedule.children) == 3 @@ -250,7 +250,7 @@ def check(schedule, f1depth, f2depth): field 'f1' is what we are expecting :param schedule: a dynamo0.3 API schedule object - :type schedule: :py:class:`psyclone.dynamo0p3.DynInvokeSchedule`. + :type schedule: :py:class:`psyclone.dynamo0p3.LFRicInvokeSchedule`. :param int f1depth: The expected depth of the halo exchange \ associated with field f1 :param int f2depth: The expected depth of the halo exchange \ @@ -316,7 +316,7 @@ def check(schedule, f1depth, f2depth): field 'f1' is what we are expecting :param schedule: a dynamo0.3 API schedule object - :type schedule: :py:class:`psyclone.dynamo0p3.DynInvokeSchedule`. + :type schedule: :py:class:`psyclone.dynamo0p3.LFRicInvokeSchedule`. :param int f1depth: The expected depth of the halo exchange \ associated with field f1 :param int f2depth: The expected depth of the halo exchange \ diff --git a/src/psyclone/tests/psyGen_test.py b/src/psyclone/tests/psyGen_test.py index 91136c5ba9..9bf5ab0480 100644 --- a/src/psyclone/tests/psyGen_test.py +++ b/src/psyclone/tests/psyGen_test.py @@ -54,7 +54,7 @@ from psyclone.domain.common.psylayer import PSyLoop from psyclone.domain.lfric import lfric_builtins, LFRicKern, LFRicKernMetadata from psyclone.domain.lfric.transformations import LFRicLoopFuseTrans -from psyclone.dynamo0p3 import (DynInvokeSchedule, DynGlobalSum, +from psyclone.dynamo0p3 import (LFRicInvokeSchedule, DynGlobalSum, DynKernelArguments) from psyclone.errors import FieldNotFoundError, GenerationError, InternalError from psyclone.generator import generate @@ -294,12 +294,12 @@ def test_invokes_can_always_be_printed(): assert inv.__str__() == "invoke()" invoke_call = InvokeCall([], "TestName") - inv = Invoke(invoke_call, 12, DynInvokeSchedule, None) + inv = Invoke(invoke_call, 12, LFRicInvokeSchedule, None) # Name is converted to lower case if set in constructor of InvokeCall: assert inv.__str__() == "invoke_testname()" invoke_call._name = None - inv = Invoke(invoke_call, 12, DynInvokeSchedule, None) + inv = Invoke(invoke_call, 12, LFRicInvokeSchedule, None) assert inv.__str__() == "invoke_12()" # Last test case: one kernel call - to avoid constructing @@ -310,7 +310,7 @@ def test_invokes_can_always_be_printed(): api="dynamo0.3") alg_invocation = invoke.calls[0] - inv = Invoke(alg_invocation, 0, DynInvokeSchedule, None) + inv = Invoke(alg_invocation, 0, LFRicInvokeSchedule, None) assert inv.__str__() == \ "invoke_0_testkern_type(a, f1_my_field, f1 % my_field, m1, m2)" @@ -322,7 +322,7 @@ def test_invoke_container(): api="dynamo0.3") alg_invocation = invoke.calls[0] # An isolated Invoke object has no associated Container - inv = Invoke(alg_invocation, 0, DynInvokeSchedule, None) + inv = Invoke(alg_invocation, 0, LFRicInvokeSchedule, None) assert inv._schedule.parent is None # Creating an Invokes object requires a PSy object but the construction of # the latter also creates the former. Therefore, we just create a PSy diff --git a/src/psyclone/transformations.py b/src/psyclone/transformations.py index bfdf38527e..eba1ab729f 100644 --- a/src/psyclone/transformations.py +++ b/src/psyclone/transformations.py @@ -51,7 +51,7 @@ from psyclone.domain.lfric import (KernCallArgList, LFRicConstants, LFRicKern, LFRicLoop) from psyclone.dynamo0p3 import (LFRicHaloExchangeEnd, LFRicHaloExchangeStart, - DynInvokeSchedule) + LFRicInvokeSchedule) from psyclone.errors import InternalError from psyclone.gocean1p0 import GOInvokeSchedule from psyclone.nemo import NemoInvokeSchedule @@ -1702,7 +1702,7 @@ def validate(self, node, options=None): :py:class:`psyclone.psyir.nodes.Directive`. :raises TransformationError: if the parent of the loop is not a\ :py:class:`psyclone.psyir.nodes.Loop` or a\ - :py:class:`psyclone.psyGen.DynInvokeSchedule`. + :py:class:`psyclone.psyGen.LFRicInvokeSchedule`. :raises TransformationError: if the parent of the loop is a\ :py:class:`psyclone.psyir.nodes.Loop` but the original loop does\ not iterate over 'colour'. @@ -1711,7 +1711,7 @@ def validate(self, node, options=None): iterate over 'colours'. :raises TransformationError: if the parent of the loop is a\ :py:class:`psyclone.psyir.nodes.Loop` but the parent's parent is\ - not a :py:class:`psyclone.psyGen.DynInvokeSchedule`. + not a :py:class:`psyclone.psyGen.LFRicInvokeSchedule`. :raises TransformationError: if this transformation is applied\ when distributed memory is not switched on. :raises TransformationError: if the loop does not iterate over\ @@ -1756,12 +1756,12 @@ def validate(self, node, options=None): f"method the supplied loop is sits beneath a directive of " f"type {type(dir_node)}. Redundant computation must be applied" f" before directives are added.") - if not (isinstance(node.parent, DynInvokeSchedule) or + if not (isinstance(node.parent, LFRicInvokeSchedule) or isinstance(node.parent.parent, Loop)): raise TransformationError( f"In the Dynamo0p3RedundantComputation transformation " f"apply method the parent of the supplied loop must be the " - f"DynInvokeSchedule, or a Loop, but found {type(node.parent)}") + f"LFRicInvokeSchedule, or a Loop, but found {type(node.parent)}") if isinstance(node.parent.parent, Loop): if node.loop_type != "colour": raise TransformationError( @@ -1775,12 +1775,12 @@ def validate(self, node, options=None): f"apply method, if the parent of the supplied Loop is " f"also a Loop then the parent must iterate over " f"'colours', but found '{node.parent.parent.loop_type}'") - if not isinstance(node.parent.parent.parent, DynInvokeSchedule): + if not isinstance(node.parent.parent.parent, LFRicInvokeSchedule): raise TransformationError( f"In the Dynamo0p3RedundantComputation transformation " f"apply method, if the parent of the supplied Loop is " f"also a Loop then the parent's parent must be the " - f"DynInvokeSchedule, but found {type(node.parent)}") + f"LFRicInvokeSchedule, but found {type(node.parent)}") if not Config.get().distributed_memory: raise TransformationError( "In the Dynamo0p3RedundantComputation transformation apply " @@ -2345,7 +2345,7 @@ def apply(self, sched, options=None): self.validate(sched, options) # pylint: disable=import-outside-toplevel - if isinstance(sched, DynInvokeSchedule): + if isinstance(sched, LFRicInvokeSchedule): from psyclone.dynamo0p3 import DynACCEnterDataDirective as \ AccEnterDataDir elif isinstance(sched, GOInvokeSchedule): @@ -2676,7 +2676,7 @@ def validate(self, nodes, options): node_list = self.get_node_list(nodes) # Check that the front-end is valid - sched = node_list[0].ancestor((NemoInvokeSchedule, DynInvokeSchedule)) + sched = node_list[0].ancestor((NemoInvokeSchedule, LFRicInvokeSchedule)) if not sched: raise NotImplementedError( "OpenACC kernels regions are currently only supported for the "