Skip to content

Commit

Permalink
#2244 Fix some issues processing LFRic trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Oct 21, 2024
1 parent 18193fb commit 1832911
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
16 changes: 2 additions & 14 deletions src/psyclone/domain/lfric/lfric_kern.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/psyclone/dynamo0p3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
Expand Down Expand Up @@ -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 "
Expand Down
3 changes: 2 additions & 1 deletion src/psyclone/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 1832911

Please sign in to comment.