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

Public Member Functions

def __str__ (self)
 
def name (self)
 
def apply (self, node, options=None)
 
def validate (self, node, options)
 

Detailed Description

Splits a synchronous halo exchange into a halo exchange start and
halo exchange end. For example:

>>> from psyclone.parse.algorithm import parse
>>> from psyclone.psyGen import PSyFactory
>>> api = "dynamo0.3"
>>> ast, invokeInfo = parse("file.f90", api=api)
>>> psy=PSyFactory(api).create(invokeInfo)
>>> schedule = psy.invokes.get('invoke_0').schedule
>>> # Uncomment the following line to see a text view of the schedule
>>> # print(schedule.view())
>>>
>>> from psyclone.transformations import Dynamo0p3AsyncHaloExchangeTrans
>>> trans = Dynamo0p3AsyncHaloExchangeTrans()
>>> trans.apply(schedule.children[0])
>>> # Uncomment the following line to see a text view of the schedule
>>> # print(schedule.view())

Definition at line 1991 of file transformations.py.

Member Function Documentation

◆ apply()

def psyclone.transformations.Dynamo0p3AsyncHaloExchangeTrans.apply (   self,
  node,
  options = None 
)
Transforms a synchronous halo exchange, represented by a
HaloExchange node, into an asynchronous halo exchange,
represented by HaloExchangeStart and HaloExchangeEnd nodes.

:param node: a synchronous haloexchange node.
:type node: :py:obj:`psyclone.psygen.HaloExchange`
:param options: a dictionary with options for transformations.
:type options: Optional[Dict[str, Any]]

Reimplemented from psyclone.psyGen.Transformation.

Definition at line 2023 of file transformations.py.

2023  def apply(self, node, options=None):
2024  '''Transforms a synchronous halo exchange, represented by a
2025  HaloExchange node, into an asynchronous halo exchange,
2026  represented by HaloExchangeStart and HaloExchangeEnd nodes.
2027 
2028  :param node: a synchronous haloexchange node.
2029  :type node: :py:obj:`psyclone.psygen.HaloExchange`
2030  :param options: a dictionary with options for transformations.
2031  :type options: Optional[Dict[str, Any]]
2032 
2033  '''
2034  self.validate(node, options)
2035 
2036  # add asynchronous start and end halo exchanges and initialise
2037  # them using information from the existing synchronous halo
2038  # exchange
2039  # pylint: disable=protected-access
2040  node.parent.addchild(
2041  LFRicHaloExchangeStart(
2042  node.field, check_dirty=node._check_dirty,
2043  vector_index=node.vector_index, parent=node.parent),
2044  index=node.position)
2045  node.parent.addchild(
2046  LFRicHaloExchangeEnd(
2047  node.field, check_dirty=node._check_dirty,
2048  vector_index=node.vector_index, parent=node.parent),
2049  index=node.position)
2050 
2051  # remove the existing synchronous halo exchange
2052  node.detach()
2053 

References psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata.validate(), psyclone.transformations.MoveTrans.validate(), psyclone.transformations.Dynamo0p3AsyncHaloExchangeTrans.validate(), psyclone.domain.common.transformations.alg_invoke_2_psy_call_trans.AlgInvoke2PSyCallTrans.validate(), psyclone.domain.common.transformations.alg_trans.AlgTrans.validate(), psyclone.domain.common.transformations.kernel_module_inline_trans.KernelModuleInlineTrans.validate(), psyclone.domain.common.transformations.raise_psyir_2_alg_trans.RaisePSyIR2AlgTrans.validate(), psyclone.domain.gocean.transformations.gocean_const_loop_bounds_trans.GOConstLoopBoundsTrans.validate(), psyclone.domain.gocean.transformations.gocean_move_iteration_boundaries_inside_kernel_trans.GOMoveIterationBoundariesInsideKernelTrans.validate(), psyclone.domain.gocean.transformations.gocean_opencl_trans.GOOpenCLTrans.validate(), psyclone.domain.gocean.transformations.raise_psyir_2_gocean_kern_trans.RaisePSyIR2GOceanKernTrans.validate(), psyclone.domain.lfric.transformations.lfric_alg_invoke_2_psy_call_trans.LFRicAlgInvoke2PSyCallTrans.validate(), psyclone.domain.lfric.transformations.raise_psyir_2_lfric_kern_trans.RaisePSyIR2LFRicKernTrans.validate(), psyclone.domain.nemo.transformations.create_nemo_invoke_schedule_trans.CreateNemoInvokeScheduleTrans.validate(), psyclone.domain.nemo.transformations.create_nemo_psy_trans.CreateNemoPSyTrans.validate(), psyclone.domain.nemo.transformations.nemo_allarrayrange2loop_trans.NemoAllArrayRange2LoopTrans.validate(), psyclone.domain.nemo.transformations.nemo_arrayrange2loop_trans.NemoArrayRange2LoopTrans.validate(), psyclone.domain.nemo.transformations.nemo_outerarrayrange2loop_trans.NemoOuterArrayRange2LoopTrans.validate(), psyclone.psyad.transformations.assignment_trans.AssignmentTrans.validate(), psyclone.psyGen.Transformation.validate(), psyclone.psyir.transformations.acc_update_trans.ACCUpdateTrans.validate(), psyclone.psyir.transformations.allarrayaccess2loop_trans.AllArrayAccess2LoopTrans.validate(), psyclone.psyir.transformations.arrayaccess2loop_trans.ArrayAccess2LoopTrans.validate(), psyclone.psyir.transformations.arrayrange2loop_trans.ArrayRange2LoopTrans.validate(), psyclone.psyir.transformations.chunk_loop_trans.ChunkLoopTrans.validate(), psyclone.psyir.transformations.fold_conditional_return_expressions_trans.FoldConditionalReturnExpressionsTrans.validate(), psyclone.psyir.transformations.hoist_local_arrays_trans.HoistLocalArraysTrans.validate(), psyclone.psyir.transformations.hoist_loop_bound_expr_trans.HoistLoopBoundExprTrans.validate(), psyclone.psyir.transformations.hoist_trans.HoistTrans.validate(), psyclone.psyir.transformations.inline_trans.InlineTrans.validate(), psyclone.psyir.transformations.intrinsics.array_reduction_base_trans.ArrayReductionBaseTrans.validate(), psyclone.psyir.transformations.intrinsics.dotproduct2code_trans.DotProduct2CodeTrans.validate(), psyclone.psyir.transformations.intrinsics.intrinsic2code_trans.Intrinsic2CodeTrans.validate(), psyclone.psyir.transformations.intrinsics.matmul2code_trans.Matmul2CodeTrans.validate(), psyclone.psyir.transformations.loop_swap_trans.LoopSwapTrans.validate(), psyclone.psyir.transformations.loop_tiling_2d_trans.LoopTiling2DTrans.validate(), psyclone.psyir.transformations.loop_trans.LoopTrans.validate(), psyclone.psyir.transformations.omp_task_trans.OMPTaskTrans.validate(), psyclone.psyir.transformations.omp_taskwait_trans.OMPTaskwaitTrans.validate(), psyclone.psyir.transformations.parallel_loop_trans.ParallelLoopTrans.validate(), psyclone.psyir.transformations.reference2arrayrange_trans.Reference2ArrayRangeTrans.validate(), psyclone.psyir.transformations.replace_induction_variables_trans.ReplaceInductionVariablesTrans.validate(), psyclone.transformations.OMPDeclareTargetTrans.validate(), psyclone.transformations.DynamoOMPParallelLoopTrans.validate(), psyclone.transformations.Dynamo0p3OMPLoopTrans.validate(), psyclone.transformations.GOceanOMPLoopTrans.validate(), psyclone.transformations.Dynamo0p3RedundantComputationTrans.validate(), psyclone.transformations.Dynamo0p3KernelConstTrans.validate(), psyclone.transformations.ACCRoutineTrans.validate(), psyclone.transformations.KernelImportsToArguments.validate(), psyclone.domain.gocean.transformations.gocean_loop_fuse_trans.GOceanLoopFuseTrans.validate(), psyclone.domain.lfric.transformations.lfric_loop_fuse_trans.LFRicLoopFuseTrans.validate(), psyclone.psyir.transformations.loop_fuse_trans.LoopFuseTrans.validate(), psyclone.domain.gocean.transformations.gocean_extract_trans.GOceanExtractTrans.validate(), psyclone.domain.lfric.transformations.lfric_extract_trans.LFRicExtractTrans.validate(), psyclone.psyir.transformations.extract_trans.ExtractTrans.validate(), psyclone.psyir.transformations.nan_test_trans.NanTestTrans.validate(), psyclone.psyir.transformations.read_only_verify_trans.ReadOnlyVerifyTrans.validate(), psyclone.transformations.ParallelRegionTrans.validate(), psyclone.transformations.OMPParallelTrans.validate(), psyclone.transformations.ACCParallelTrans.validate(), psyclone.transformations.ACCKernelsTrans.validate(), psyclone.transformations.ACCDataTrans.validate(), psyclone.psyir.transformations.psy_data_trans.PSyDataTrans.validate(), psyclone.psyir.transformations.region_trans.RegionTrans.validate(), and psyclone.transformations.ACCEnterDataTrans.validate().

Here is the call graph for this function:

◆ name()

def psyclone.transformations.Dynamo0p3AsyncHaloExchangeTrans.name (   self)
:returns: the name of this transformation as a string.
:rtype: str

Reimplemented from psyclone.psyGen.Transformation.

Definition at line 2016 of file transformations.py.

2016  def name(self):
2017  '''
2018  :returns: the name of this transformation as a string.
2019  :rtype: str
2020  '''
2021  return "Dynamo0p3AsyncHaloExchangeTrans"
2022 
Here is the caller graph for this function:

◆ validate()

def psyclone.transformations.Dynamo0p3AsyncHaloExchangeTrans.validate (   self,
  node,
  options 
)
Internal method to check whether the node is valid for this
transformation.

:param node: a synchronous Halo Exchange node
:type node: :py:obj:`psyclone.psygen.HaloExchange`
:param options: a dictionary with options for transformations.
:type options: Optional[Dict[str, Any]]

:raises TransformationError: if the node argument is not a
                 HaloExchange (or subclass thereof)

Reimplemented from psyclone.psyGen.Transformation.

Definition at line 2054 of file transformations.py.

2054  def validate(self, node, options):
2055  # pylint: disable=signature-differs
2056  '''Internal method to check whether the node is valid for this
2057  transformation.
2058 
2059  :param node: a synchronous Halo Exchange node
2060  :type node: :py:obj:`psyclone.psygen.HaloExchange`
2061  :param options: a dictionary with options for transformations.
2062  :type options: Optional[Dict[str, Any]]
2063 
2064  :raises TransformationError: if the node argument is not a
2065  HaloExchange (or subclass thereof)
2066 
2067  '''
2068  if not isinstance(node, psyGen.HaloExchange) or \
2069  isinstance(node, (LFRicHaloExchangeStart, LFRicHaloExchangeEnd)):
2070  raise TransformationError(
2071  f"Error in Dynamo0p3AsyncHaloExchange transformation. Supplied"
2072  f" node must be a synchronous halo exchange but found "
2073  f"'{type(node)}'.")
2074 
2075 
Here is the caller graph for this function:

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