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

Public Member Functions

def __init__ (self)
 
def __str__ (self)
 
def name (self)
 
- Public Member Functions inherited from psyclone.transformations.ParallelRegionTrans
def validate (self, node_list, options=None)
 
def apply (self, target_nodes, options=None)
 
- Public Member Functions inherited from psyclone.psyir.transformations.region_trans.RegionTrans
def get_node_list (self, nodes)
 

Static Public Attributes

tuple excluded_node_types
 
- Static Public Attributes inherited from psyclone.transformations.ParallelRegionTrans
tuple excluded_node_types = (CodeBlock, Return, psyGen.HaloExchange)
 
- Static Public Attributes inherited from psyclone.psyir.transformations.region_trans.RegionTrans
tuple excluded_node_types = ()
 

Detailed Description

Create an OpenMP MASTER region by inserting directives. The most
likely use case for this transformation is to wrap around task-based
transformations. Note that adding this directive requires a parent
OpenMP parallel region (which can be inserted by OMPParallelTrans),
otherwise it will produce an error in generation-time.

For example:

>>> from psyclone.parse.algorithm import parse
>>> from psyclone.psyGen import PSyFactory
>>> api = "gocean1.0"
>>> ast, invokeInfo = parse(GOCEAN_SOURCE_FILE, api=api)
>>> psy = PSyFactory(api).create(invokeInfo)
>>>
>>> from psyclone.transformations import OMPParallelTrans, OMPMasterTrans
>>> mastertrans = OMPMasterTrans()
>>> paralleltrans = OMPParallelTrans()
>>>
>>> schedule = psy.invokes.get('invoke_0').schedule
>>> # Uncomment the following line to see a text view of the schedule
>>> # print(schedule.view())
>>>
>>> # Enclose all of these loops within a single OpenMP
>>> # MASTER region
>>> mastertrans.apply(schedule.children)
>>> # Enclose all of these loops within a single OpenMP
>>> # PARALLEL region
>>> paralleltrans.apply(schedule.children)
>>> # Uncomment the following line to see a text view of the schedule
>>> # print(schedule.view())

Definition at line 1411 of file transformations.py.

Member Function Documentation

◆ name()

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

Reimplemented from psyclone.psyGen.Transformation.

Definition at line 1459 of file transformations.py.

1459  def name(self):
1460  '''
1461  :returns: the name of this transformation as a string.
1462  :rtype: str
1463  '''
1464  return "OMPMasterTrans"
1465 
1466 
Here is the caller graph for this function:

Member Data Documentation

◆ excluded_node_types

tuple psyclone.transformations.OMPMasterTrans.excluded_node_types
static
Initial value:
= (CodeBlock, Return, ACCDirective,
psyGen.HaloExchange, OMPSerialDirective,
OMPParallelDirective)

Definition at line 1446 of file transformations.py.


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