Reference Guide  2.5.0
psyclone.dynamo0p3.HaloDepth Class Reference
Inheritance diagram for psyclone.dynamo0p3.HaloDepth:

Public Member Functions

def __init__ (self, sym_table)
 
def annexed_only (self)
 
def max_depth (self)
 
def max_depth_m1 (self)
 
def var_depth (self)
 
def literal_depth (self)
 
def literal_depth (self, value)
 
def set_by_value (self, max_depth, var_depth, literal_depth, annexed_only, max_depth_m1)
 
def __str__ (self)
 
def psyir_expression (self)
 

Detailed Description

Determines how much of the halo a read to a field accesses (the
halo depth).

:param sym_table: the symbol table of the enclosing InvokeSchedule.
:type sym_table: :py:class:`psyclone.psyir.symbols.SymbolTable`

Definition at line 4418 of file dynamo0p3.py.

Member Function Documentation

◆ __str__()

def psyclone.dynamo0p3.HaloDepth.__str__ (   self)
return the depth of a halo dependency
as a string

Definition at line 4545 of file dynamo0p3.py.

4545  def __str__(self):
4546  '''return the depth of a halo dependency
4547  as a string'''
4548  depth_str = ""
4549  if self.max_depth:
4550  max_depth = self._symbol_table.lookup_with_tag(
4551  "max_halo_depth_mesh")
4552  depth_str += max_depth.name
4553  elif self.max_depth_m1:
4554  max_depth = self._symbol_table.lookup_with_tag(
4555  "max_halo_depth_mesh")
4556  depth_str += f"{max_depth.name}-1"
4557  else:
4558  if self.var_depth:
4559  depth_str += self.var_depth
4560  if self.literal_depth:
4561  # Ignores depth == 0
4562  depth_str += f"+{self.literal_depth}"
4563  elif self.literal_depth is not None:
4564  # Returns depth if depth has any value, including 0
4565  depth_str = str(self.literal_depth)
4566  return depth_str
4567 

References psyclone.domain.lfric.lfric_collection.LFRicCollection._symbol_table, psyclone.dynamo0p3.DynMeshes._symbol_table, psyclone.dynamo0p3.HaloDepth._symbol_table, psyclone.psyGen.HaloExchange._symbol_table, psyclone.psyir.backend.sympy_writer.SymPyWriter._symbol_table, psyclone.psyir.nodes.scoping_node.ScopingNode._symbol_table, psyclone.dynamo0p3.HaloDepth.literal_depth(), psyclone.dynamo0p3.HaloDepth.max_depth(), psyclone.dynamo0p3.HaloDepth.max_depth_m1(), and psyclone.dynamo0p3.HaloDepth.var_depth().

Here is the call graph for this function:

◆ annexed_only()

def psyclone.dynamo0p3.HaloDepth.annexed_only (   self)
:returns: True if only annexed dofs are accessed in the halo and \
          False otherwise.
:rtype: bool

Definition at line 4458 of file dynamo0p3.py.

4458  def annexed_only(self):
4459  '''
4460  :returns: True if only annexed dofs are accessed in the halo and \
4461  False otherwise.
4462  :rtype: bool
4463  '''
4464  return self._annexed_only
4465 

References psyclone.dynamo0p3.HaloDepth._annexed_only, and psyclone.dynamo0p3.HaloReadAccess._annexed_only.

◆ literal_depth() [1/2]

def psyclone.dynamo0p3.HaloDepth.literal_depth (   self)
Returns the known fixed (literal) depth of halo access. Note, this
depth should be added to the var_depth to find the total depth.

:returns: the known fixed (literal) halo access depth.
:rtype: int

Definition at line 4502 of file dynamo0p3.py.

4502  def literal_depth(self):
4503  '''Returns the known fixed (literal) depth of halo access. Note, this
4504  depth should be added to the var_depth to find the total depth.
4505 
4506  :returns: the known fixed (literal) halo access depth.
4507  :rtype: int
4508 
4509  '''
4510  return self._literal_depth
4511 

References psyclone.dynamo0p3.HaloDepth._literal_depth, and psyclone.dynamo0p3.HaloReadAccess._literal_depth.

Here is the caller graph for this function:

◆ literal_depth() [2/2]

def psyclone.dynamo0p3.HaloDepth.literal_depth (   self,
  value 
)
 Set the known fixed (literal) depth of halo access.

:param int value: Set the known fixed (literal) halo access depth.

Definition at line 4513 of file dynamo0p3.py.

4513  def literal_depth(self, value):
4514  ''' Set the known fixed (literal) depth of halo access.
4515 
4516  :param int value: Set the known fixed (literal) halo access depth.
4517 
4518  '''
4519  self._literal_depth = value
4520 

References psyclone.dynamo0p3.HaloDepth._literal_depth, psyclone.dynamo0p3.HaloReadAccess._literal_depth, and psyclone.dynamo0p3.HaloDepth.literal_depth().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max_depth()

def psyclone.dynamo0p3.HaloDepth.max_depth (   self)
:returns: True if the read to the field is known to access all \
          of the halo and False otherwise.
:rtype: bool

Definition at line 4467 of file dynamo0p3.py.

4467  def max_depth(self):
4468  '''
4469  :returns: True if the read to the field is known to access all \
4470  of the halo and False otherwise.
4471  :rtype: bool
4472  '''
4473  return self._max_depth
4474 

References psyclone.dynamo0p3.HaloDepth._max_depth, and psyclone.dynamo0p3.HaloReadAccess._max_depth.

Here is the caller graph for this function:

◆ max_depth_m1()

def psyclone.dynamo0p3.HaloDepth.max_depth_m1 (   self)
Returns whether the read to the field is known to access all of the
halo except the outermost level or not.

:returns: True if the read to the field is known to access all \
          of the halo except the outermost and False otherwise.
:rtype: bool

Definition at line 4476 of file dynamo0p3.py.

4476  def max_depth_m1(self):
4477  '''Returns whether the read to the field is known to access all of the
4478  halo except the outermost level or not.
4479 
4480  :returns: True if the read to the field is known to access all \
4481  of the halo except the outermost and False otherwise.
4482  :rtype: bool
4483 
4484  '''
4485  return self._max_depth_m1
4486 

References psyclone.dynamo0p3.HaloDepth._max_depth_m1.

Here is the caller graph for this function:

◆ psyir_expression()

def psyclone.dynamo0p3.HaloDepth.psyir_expression (   self)
:returns: the PSyIR expression representing this HaloDepth.
:rtype: :py:class:`psyclone.psyir.nodes.Node`

Definition at line 4568 of file dynamo0p3.py.

4568  def psyir_expression(self):
4569  '''
4570  :returns: the PSyIR expression representing this HaloDepth.
4571  :rtype: :py:class:`psyclone.psyir.nodes.Node`
4572  '''
4573  if self.max_depth:
4574  max_depth = self._symbol_table.lookup_with_tag(
4575  "max_halo_depth_mesh")
4576  return Reference(max_depth)
4577  if self.max_depth_m1:
4578  max_depth = self._symbol_table.lookup_with_tag(
4579  "max_halo_depth_mesh")
4580  return BinaryOperation.create(
4581  BinaryOperation.Operator.SUB,
4582  Reference(max_depth),
4583  Literal('1', INTEGER_TYPE))
4584  if self.var_depth:
4585  depth_ref = Reference(self._symbol_table.lookup(self.var_depth))
4586  if self.literal_depth != 0: # Ignores depth == 0
4587  return BinaryOperation.create(
4588  BinaryOperation.Operator.ADD,
4589  depth_ref,
4590  Literal(f"{self.literal_depth}", INTEGER_TYPE))
4591  return depth_ref
4592  # Returns depth if depth has any value, including 0
4593  return Literal(str(self.literal_depth), INTEGER_TYPE)
4594 
4595 

References psyclone.domain.lfric.lfric_collection.LFRicCollection._symbol_table, psyclone.dynamo0p3.DynMeshes._symbol_table, psyclone.dynamo0p3.HaloDepth._symbol_table, psyclone.psyGen.HaloExchange._symbol_table, psyclone.psyir.backend.sympy_writer.SymPyWriter._symbol_table, psyclone.psyir.nodes.scoping_node.ScopingNode._symbol_table, psyclone.dynamo0p3.HaloDepth.literal_depth(), psyclone.dynamo0p3.HaloDepth.max_depth(), psyclone.dynamo0p3.HaloDepth.max_depth_m1(), and psyclone.dynamo0p3.HaloDepth.var_depth().

Here is the call graph for this function:

◆ set_by_value()

def psyclone.dynamo0p3.HaloDepth.set_by_value (   self,
  max_depth,
  var_depth,
  literal_depth,
  annexed_only,
  max_depth_m1 
)
Set halo depth information directly

:param bool max_depth: True if the field accesses all of the \
halo and False otherwise
:param str var_depth: A variable name specifying the halo \
access depth, if one exists, and None if not
:param int literal_depth: The known fixed (literal) halo \
access depth
:param bool annexed_only: True if only the halo's annexed dofs \
are accessed and False otherwise
:param bool max_depth_m1: True if the field accesses all of \
the halo but does not require the outermost halo to be correct \
and False otherwise

Definition at line 4521 of file dynamo0p3.py.

4522  max_depth_m1):
4523  # pylint: disable=too-many-arguments
4524  '''Set halo depth information directly
4525 
4526  :param bool max_depth: True if the field accesses all of the \
4527  halo and False otherwise
4528  :param str var_depth: A variable name specifying the halo \
4529  access depth, if one exists, and None if not
4530  :param int literal_depth: The known fixed (literal) halo \
4531  access depth
4532  :param bool annexed_only: True if only the halo's annexed dofs \
4533  are accessed and False otherwise
4534  :param bool max_depth_m1: True if the field accesses all of \
4535  the halo but does not require the outermost halo to be correct \
4536  and False otherwise
4537 
4538  '''
4539  self._max_depth = max_depth
4540  self._var_depth = var_depth
4541  self._literal_depth = literal_depth
4542  self._annexed_only = annexed_only
4543  self._max_depth_m1 = max_depth_m1
4544 

References psyclone.dynamo0p3.HaloDepth._annexed_only, psyclone.dynamo0p3.HaloReadAccess._annexed_only, psyclone.dynamo0p3.HaloDepth._literal_depth, psyclone.dynamo0p3.HaloReadAccess._literal_depth, psyclone.dynamo0p3.HaloDepth._max_depth, psyclone.dynamo0p3.HaloReadAccess._max_depth, psyclone.dynamo0p3.HaloDepth._max_depth_m1, psyclone.dynamo0p3.HaloDepth._var_depth, and psyclone.dynamo0p3.HaloReadAccess._var_depth.

◆ var_depth()

def psyclone.dynamo0p3.HaloDepth.var_depth (   self)
Returns the name of the variable specifying the depth of halo
access if one is provided. Note, a variable will only be provided for
stencil accesses. Also note, this depth should be added to the
literal_depth to find the total depth.

:returns: a variable name specifying the halo access depth \
          if one exists, and None if not.
:rtype: str

Definition at line 4488 of file dynamo0p3.py.

4488  def var_depth(self):
4489  '''Returns the name of the variable specifying the depth of halo
4490  access if one is provided. Note, a variable will only be provided for
4491  stencil accesses. Also note, this depth should be added to the
4492  literal_depth to find the total depth.
4493 
4494  :returns: a variable name specifying the halo access depth \
4495  if one exists, and None if not.
4496  :rtype: str
4497 
4498  '''
4499  return self._var_depth
4500 

References psyclone.dynamo0p3.HaloDepth._var_depth, and psyclone.dynamo0p3.HaloReadAccess._var_depth.

Here is the caller graph for this function:

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