loki.transformations.parallel.block_loop

Transformation utilities to remove and generate parallel block loops.

Functions

add_block_loops(routine, dimension[, ...])

Insert IFS-style (NPROMA) driver block-loops in !$loki parallel regions.

remove_block_loops(routine, dimension)

Remove any outer block Loop from a given :any:`Subroutine.

remove_block_loops(routine, dimension)

Remove any outer block Loop from a given :any:`Subroutine.

The loops are identified according to a given Dimension object, and will remove auxiliary assignments of index and bound variables, as commonly used in IFS-style block loops.

Parameters:
  • routine (Subroutine) – Subroutine from which to remove block loops

  • dimension (Dimension) – The dimension object describing loop variables

add_block_loops(routine, dimension, default_type=None)

Insert IFS-style (NPROMA) driver block-loops in !$loki parallel regions.

The provided Dimension object describes the variables to used when generating the loop and default assignments. It encapsulates IFS-specific convention, where a strided loop over points, defined by dimension.index, dimension.bounds and dimension.step is created, alongside assignments that define the corresponding block index and upper bound, defined by dimension.indices[1] and dimension.upper[1] respectively.

Parameters:
  • routine (Subroutine) – The routine in which to add block loops.

  • dimension (Dimension) – The dimension object describing the block loop variables.

  • default_type (SymbolAttributes, optional) – Default type to use when creating variables; defaults to integer(kind=JPIM).