From 18329119db5e9dce0f7a7fc17c31d37a45bca543 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Mon, 21 Oct 2024 11:46:36 +0100 Subject: [PATCH] #2244 Fix some issues processing LFRic trunk --- src/psyclone/domain/lfric/lfric_kern.py | 16 ++-------------- src/psyclone/dynamo0p3.py | 3 ++- src/psyclone/transformations.py | 3 ++- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/psyclone/domain/lfric/lfric_kern.py b/src/psyclone/domain/lfric/lfric_kern.py index 9a7031c67d..e494e2ff50 100644 --- a/src/psyclone/domain/lfric/lfric_kern.py +++ b/src/psyclone/domain/lfric/lfric_kern.py @@ -444,13 +444,7 @@ def tilecolourmap(self): f"coloured loop.") sched = self.ancestor(InvokeSchedule) if self.is_intergrid: - invoke = sched.invoke - if id(self) not in invoke.meshes.intergrid_kernels: - raise InternalError( - f"Tilecolourmap information for kernel '{self.name}'" - f" has not yet been initialised") - tmap = invoke.meshes.intergrid_kernels[id(self)].\ - tilecolourmap_symbol.name + tmap = self._intergrid_ref.tilecolourmap_symbol.name else: try: tmap = sched.symbol_table.lookup_with_tag("tmap").name @@ -533,13 +527,7 @@ def ntilecolours_var(self): raise InternalError(f"Kernel '{self.name}' is not inside a " f"coloured loop.") if self.is_intergrid: - invoke = self.ancestor(InvokeSchedule).invoke - if id(self) not in invoke.meshes.intergrid_kernels: - raise InternalError( - f"Colourmap information for kernel '{self.name}' has " - f"not yet been initialised") - kernel = invoke.meshes.intergrid_kernels[id(self)] - ncols_sym = kernel.ntilecolours_var_symbol + ncols_sym = self._intergrid_ref.ntilecolours_var_symbol if not ncols_sym: return None return ncols_sym.name diff --git a/src/psyclone/dynamo0p3.py b/src/psyclone/dynamo0p3.py index 99d13d5f95..7418bf653e 100644 --- a/src/psyclone/dynamo0p3.py +++ b/src/psyclone/dynamo0p3.py @@ -2592,7 +2592,7 @@ def initialise(self, parent): pointer=True, rhs=coarse_mesh + "%get_tilecolour_map()")) # Last halo/edge cell per colour. - sym = dig.last_cell_var_symbol + sym = dig.last_cell_tile_var_symbol if len(sym.datatype.shape) == 2: # Array is 2D so is a halo access. name = "%get_last_halo_tile_per_colours2()" @@ -5002,6 +5002,7 @@ def _compute_from_field(self, field): self._stencil_type = "region" if field.descriptor.stencil: # field has a stencil access + # import pdb; pdb.set_trace() if self._max_depth: raise GenerationError( "redundant computation to max depth with a stencil is " diff --git a/src/psyclone/transformations.py b/src/psyclone/transformations.py index 22b4d59b74..764ce71eb3 100644 --- a/src/psyclone/transformations.py +++ b/src/psyclone/transformations.py @@ -922,7 +922,8 @@ def validate(self, node, options=None): # If the loop is not already coloured then check whether or not # it should be - if node.loop_type != 'colour' and node.has_inc_arg(): + if (node.loop_type not in ('colour', 'tile', 'colourtile') + and node.has_inc_arg()): raise TransformationError( f"Error in {self.name} transformation. The kernel has an " f"argument with INC access. Colouring is required.")