Reference Guide  2.5.0
psyclone.transformations.DynamoOMPParallelLoopTrans Class Reference
Inheritance diagram for psyclone.transformations.DynamoOMPParallelLoopTrans:
Collaboration diagram for psyclone.transformations.DynamoOMPParallelLoopTrans:

Public Member Functions

def __init__ (self, omp_directive="do", omp_schedule="static")
 
def __str__ (self)
 
def validate (self, node, options=None)
 
- Public Member Functions inherited from psyclone.transformations.OMPParallelLoopTrans
def apply (self, node, options=None)
 
- Public Member Functions inherited from psyclone.psyir.transformations.omp_loop_trans.OMPLoopTrans
def omp_directive (self)
 
def omp_directive (self, value)
 
def omp_schedule (self)
 
def omp_schedule (self, value)
 
- Public Member Functions inherited from psyclone.psyir.transformations.loop_trans.LoopTrans
def name (self)
 

Additional Inherited Members

- Public Attributes inherited from psyclone.psyir.transformations.omp_loop_trans.OMPLoopTrans
 omp_schedule
 
 omp_directive
 
- Static Public Attributes inherited from psyclone.psyir.transformations.parallel_loop_trans.ParallelLoopTrans
tuple excluded_node_types = (nodes.Return, psyGen.HaloExchange, nodes.CodeBlock)
 
- Static Public Attributes inherited from psyclone.psyir.transformations.loop_trans.LoopTrans
tuple excluded_node_types = ()
 

Detailed Description

 Dynamo-specific OpenMP loop transformation. Adds Dynamo specific
    validity checks. Actual transformation is done by the
    :py:class:`base class <OMPParallelLoopTrans>`.

    :param str omp_directive: choose which OpenMP loop directive to use.
        Defaults to "do".
    :param str omp_schedule: the OpenMP schedule to use. Must be one of
        'runtime', 'static', 'dynamic', 'guided' or 'auto'. Defaults to
        'static'.

Definition at line 740 of file transformations.py.

Member Function Documentation

◆ validate()

def psyclone.transformations.DynamoOMPParallelLoopTrans.validate (   self,
  node,
  options = None 
)
Perform LFRic-specific loop validity checks then call the `validate`
method of the base class.

:param node: the Node in the Schedule to check
:type node: :py:class:`psyclone.psyir.nodes.Node`
:param options: a dictionary with options for transformations.
:type options: Optional[Dict[str, Any]]

:raises TransformationError: if the supplied Node is not a LFRicLoop.
:raises TransformationError: if the associated loop requires
    colouring.

Reimplemented from psyclone.psyir.transformations.parallel_loop_trans.ParallelLoopTrans.

Definition at line 760 of file transformations.py.

760  def validate(self, node, options=None):
761  '''
762  Perform LFRic-specific loop validity checks then call the `validate`
763  method of the base class.
764 
765  :param node: the Node in the Schedule to check
766  :type node: :py:class:`psyclone.psyir.nodes.Node`
767  :param options: a dictionary with options for transformations.
768  :type options: Optional[Dict[str, Any]]
769 
770  :raises TransformationError: if the supplied Node is not a LFRicLoop.
771  :raises TransformationError: if the associated loop requires
772  colouring.
773  '''
774  if not isinstance(node, LFRicLoop):
775  raise TransformationError(
776  f"Error in {self.name} transformation. The supplied node "
777  f"must be a LFRicLoop but got '{type(node).__name__}'")
778 
779  # If the loop is not already coloured then check whether or not
780  # it should be. If the field space is discontinuous (including
781  # any_discontinuous_space) then we don't need to worry about
782  # colouring.
783  const = LFRicConstants()
784  if node.field_space.orig_name not in const.VALID_DISCONTINUOUS_NAMES:
785  if node.loop_type != 'colour' and node.has_inc_arg():
786  raise TransformationError(
787  f"Error in {self.name} transformation. The kernel has an "
788  f"argument with INC access. Colouring is required.")
789  # As this is a domain-specific loop, we don't perform general
790  # dependence analysis because it is too conservative and doesn't
791  # account for the special steps taken for such a loop at code-
792  # generation time (e.g. the way we ensure variables are given the
793  # correct sharing attributes).
794  local_options = options.copy() if options else {}
795  local_options["force"] = True
796  super().validate(node, options=local_options)
797 
798 
Here is the caller graph for this function:

The documentation for this class was generated from the following file: