psyclone.domain.gocean.transformations.gocean_move_iteration_boundaries_inside_kernel_trans

This module contains the GOMoveIterationBoundariesInsideKernelTrans.

Classes

class psyclone.domain.gocean.transformations.gocean_move_iteration_boundaries_inside_kernel_trans.GOMoveIterationBoundariesInsideKernelTrans

Provides a transformation that moves iteration boundaries that are encoded in the Loops lower_bound() and upper_bound() methods to a mask inside the kernel with the boundaries passed as kernel arguments.

For example the following kernel call:

do i = 2, N - 1
    do j = 2, N - 1
        kernel(i, j, field)
    end do
end do

will be transformed to:

startx = 2
stopx = N - 1
starty = 2
stopy = N - 1
do i = 1, size(field, 1)
    do j = 1, size(field, 2)
        kernel(i, j, field, startx, stopx, starty, stopy)
    end do
end do

additionally a mask like the following one will be introduced in the kernel code:

if (i < startx .or. i > stopx .or. j < starty .or. j > stopy) then
    return
end if

Inheritance

Inheritance diagram of GOMoveIterationBoundariesInsideKernelTrans
apply(node, options=None)

Apply this transformation to the supplied node.

Parameters:
  • node (psyclone.gocean1p0.GOKern) – the node to transform.

  • options (Optional[Dict[str, Any]]) – a dictionary with options for transformations.

property name

Returns the name of this transformation as a string.

validate(node, options=None)

Ensure that it is valid to apply this transformation to the supplied node.

Parameters:
  • node (psyclone.gocean1p0.GOKern) – the node to validate.

  • options (Optional[Dict[str, Any]]) – a dictionary with options for transformations.

Raises:

TransformationError – if the node is not a GOKern.