Reference Guide  2.5.0
psyclone.dynamo0p3.DynamoPSy Class Reference
Inheritance diagram for psyclone.dynamo0p3.DynamoPSy:
Collaboration diagram for psyclone.dynamo0p3.DynamoPSy:

Public Member Functions

def __init__ (self, invoke_info)
 
def name (self)
 
def orig_name (self)
 
def infrastructure_modules (self)
 
def gen (self)
 
- Public Member Functions inherited from psyclone.psyGen.PSy
def container (self)
 
def __str__ (self)
 
def invokes (self)
 

Detailed Description

The LFRic-specific PSy class. This creates an LFRic-specific
Invokes object (which controls all the required invocation calls).
It also overrides the PSy gen method so that we generate
LFRic-specific PSy module code.

:param invoke_info: object containing the required invocation information \
                    for code optimisation and generation.
:type invoke_info: :py:class:`psyclone.parse.algorithm.FileInfo`

Definition at line 370 of file dynamo0p3.py.

Member Function Documentation

◆ gen()

def psyclone.dynamo0p3.DynamoPSy.gen (   self)
Generate PSy code for the LFRic (Dynamo0.3) API.

:returns: root node of generated Fortran AST.
:rtype: :py:class:`psyir.nodes.Node`

Reimplemented from psyclone.psyGen.PSy.

Definition at line 457 of file dynamo0p3.py.

457  def gen(self):
458  '''
459  Generate PSy code for the LFRic (Dynamo0.3) API.
460 
461  :returns: root node of generated Fortran AST.
462  :rtype: :py:class:`psyir.nodes.Node`
463 
464  '''
465  # Create an empty PSy layer module
466  psy_module = ModuleGen(self.name)
467 
468  # If the container has a Routine that is not an InvokeSchedule
469  # it should also be added to the generated module.
470  for routine in self.container.children:
471  if not isinstance(routine, InvokeSchedule):
472  psy_module.add(PSyIRGen(psy_module, routine))
473 
474  # Add all invoke-specific information
475  self.invokes.gen_code(psy_module)
476 
477  # Include required constants and infrastructure modules. The sets of
478  # required LFRic data structures and their proxies are updated in
479  # the relevant field and operator subclasses of LFRicCollection.
480  # Here we sort the inputs in reverse order to have "_type" before
481  # "_proxy_type" and "operator_" before "columnwise_operator_".
482  # We also iterate through the dictionary in reverse order so the
483  # "use" statements for field types are before the "use" statements
484  # for operator types.
485  for infmod in reversed(self._infrastructure_modules):
486  if self._infrastructure_modules[infmod]:
487  infmod_types = sorted(
488  list(self._infrastructure_modules[infmod]), reverse=True)
489  psy_module.add(UseGen(psy_module, name=infmod,
490  only=True, funcnames=infmod_types))
491 
492  # Return the root node of the generated code
493  return psy_module.root
494 
495 

References psyclone.dynamo0p3.DynamoPSy._infrastructure_modules, psyclone.psyGen.PSy.container(), psyclone.psyir.symbols.containersymbol.ContainerSymbol.container(), psyclone.psyGen.PSy.invokes(), psyclone.psyGen.Invoke.invokes(), psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.GridArg.name, psyclone.domain.gocean.transformations.gocean_const_loop_bounds_trans.GOConstLoopBoundsTrans.name(), psyclone.domain.gocean.transformations.gocean_move_iteration_boundaries_inside_kernel_trans.GOMoveIterationBoundariesInsideKernelTrans.name(), psyclone.domain.gocean.transformations.gocean_opencl_trans.GOOpenCLTrans.name(), psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata.name, psyclone.domain.nemo.transformations.create_nemo_invoke_schedule_trans.CreateNemoInvokeScheduleTrans.name(), psyclone.domain.nemo.transformations.create_nemo_psy_trans.CreateNemoPSyTrans.name(), psyclone.domain.nemo.transformations.nemo_allarrayrange2loop_trans.NemoAllArrayRange2LoopTrans.name(), psyclone.domain.nemo.transformations.nemo_arrayrange2loop_trans.NemoArrayRange2LoopTrans.name(), psyclone.domain.nemo.transformations.nemo_outerarrayrange2loop_trans.NemoOuterArrayRange2LoopTrans.name(), psyclone.dynamo0p3.DynamoPSy.name(), psyclone.expression.FunctionVar.name, psyclone.expression.NamedArg.name(), psyclone.gocean1p0.GOKernelGridArgument.name(), psyclone.gocean1p0.GOStencil.name(), psyclone.parse.algorithm.FileInfo.name(), psyclone.parse.algorithm.InvokeCall.name(), psyclone.parse.kernel.KernelProcedure.name(), psyclone.parse.kernel.KernelType.name(), psyclone.parse.module_info.ModuleInfo.name(), psyclone.psyad.transformations.assignment_trans.AssignmentTrans.name(), psyclone.psyGen.PSy.name(), psyclone.psyGen.Invoke.name(), psyclone.psyGen.Kern.name(), psyclone.psyGen.CodedKern.name, psyclone.psyGen.Argument.name(), psyclone.psyGen.Transformation.name(), psyclone.psyGen.DummyTransformation.name(), psyclone.psyir.nodes.container.Container.name, psyclone.psyir.nodes.member.Member.name, psyclone.psyir.nodes.reference.Reference.name(), psyclone.psyir.nodes.routine.Routine.name, psyclone.psyir.symbols.symbol.Symbol.name(), psyclone.psyir.transformations.allarrayaccess2loop_trans.AllArrayAccess2LoopTrans.name(), psyclone.psyir.transformations.arrayrange2loop_trans.ArrayRange2LoopTrans.name(), psyclone.psyir.transformations.fold_conditional_return_expressions_trans.FoldConditionalReturnExpressionsTrans.name(), psyclone.psyir.transformations.loop_trans.LoopTrans.name(), psyclone.psyir.transformations.omp_task_trans.OMPTaskTrans.name(), psyclone.psyir.transformations.psy_data_trans.PSyDataTrans.name(), psyclone.transformations.OMPSingleTrans.name(), psyclone.transformations.OMPMasterTrans.name(), psyclone.transformations.OMPParallelTrans.name(), psyclone.transformations.MoveTrans.name(), psyclone.transformations.Dynamo0p3AsyncHaloExchangeTrans.name(), psyclone.transformations.Dynamo0p3KernelConstTrans.name(), psyclone.transformations.ACCEnterDataTrans.name(), psyclone.transformations.ACCRoutineTrans.name(), psyclone.transformations.ACCKernelsTrans.name(), psyclone.transformations.ACCDataTrans.name(), and psyclone.transformations.KernelImportsToArguments.name().

Here is the call graph for this function:

◆ infrastructure_modules()

def psyclone.dynamo0p3.DynamoPSy.infrastructure_modules (   self)
:returns: the dictionary that holds the names of the required \
          LFRic infrastructure modules to create "use" \
          statements in the PSy-layer modules.
:rtype: dict of set

Definition at line 446 of file dynamo0p3.py.

446  def infrastructure_modules(self):
447  '''
448  :returns: the dictionary that holds the names of the required \
449  LFRic infrastructure modules to create "use" \
450  statements in the PSy-layer modules.
451  :rtype: dict of set
452 
453  '''
454  return self._infrastructure_modules
455 

References psyclone.dynamo0p3.DynamoPSy._infrastructure_modules.

◆ name()

def psyclone.dynamo0p3.DynamoPSy.name (   self)
:returns: a name for the PSy layer. This is used as the PSy module \
          name. We override the default value as the Met Office \
          prefer "_psy" to be appended, rather than prepended.
:rtype: str

Reimplemented from psyclone.psyGen.PSy.

Definition at line 426 of file dynamo0p3.py.

426  def name(self):
427  '''
428  :returns: a name for the PSy layer. This is used as the PSy module \
429  name. We override the default value as the Met Office \
430  prefer "_psy" to be appended, rather than prepended.
431  :rtype: str
432 
433  '''
434  return self._name + "_psy"
435 

References psyclone.domain.common.algorithm.psyir.AlgorithmInvokeCall._name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata._name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.GridArg._name, psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata._name, psyclone.dynamo0p3.DynFuncDescriptor03._name, psyclone.expression.NamedArg._name, psyclone.gocean1p0.GOKernelGridArgument._name, psyclone.gocean1p0.GOStencil._name, psyclone.nemo.NemoInvoke._name, psyclone.nemo.NemoPSy._name, psyclone.parse.algorithm.FileInfo._name, psyclone.parse.algorithm.InvokeCall._name, psyclone.parse.kernel.KernelProcedure._name, psyclone.parse.kernel.KernelType._name, psyclone.parse.module_info.ModuleInfo._name, psyclone.psyGen.PSy._name, psyclone.psyGen.Invoke._name, psyclone.psyGen.Kern._name, psyclone.psyGen.Argument._name, psyclone.psyir.nodes.container.Container._name, psyclone.psyir.nodes.routine.Routine._name, and psyclone.psyir.symbols.symbol.Symbol._name.

Here is the caller graph for this function:

◆ orig_name()


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