Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 2296_add_routine_info
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Jan 11, 2024
2 parents aa01ec3 + 8fa5800 commit 98185d0
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@

42) PR #2240 for #2132. Update Integration test software stack.

43) PR #2454 for #2418. Fix OMPTaskTrans attempts to inline IntrinsicCalls.

44) PR #2459 for #2458. Fix broken documentation links.

release 2.4.0 29th of September 2023

1) PR #1758 for #1741. Splits the PSyData read functionality into a
Expand Down
4 changes: 2 additions & 2 deletions doc/user_guide/getting_going.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ support Python 2.7 was version 2.1.0.)
PSyclone immediately relies on four external Python packages; ``configparser``,
``fparser``, ``sympy``, and ``pyparsing``. The easiest way to satisfy the
Python dependencies is to use the
`PyPI installation <https://packaging.python.org/installing>`_
`PyPI installation <https://packaging.python.org/tutorials/installing-packages/>`_
and ``pip``.

If everything is working correctly then using ``pip`` to install PSyclone::
Expand Down Expand Up @@ -260,7 +260,7 @@ parser originally developed as a part of the `f2py project

``fparser`` is available from the Python Package
Index and thus may be installed using ``pip``
(https://packaging.python.org/installing/#requirements-for-installing-packages):
(https://packaging.python.org/tutorials/installing-packages/#requirements-for-installing-packages):
::

> pip install fparser
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/system_specific_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You will need a terminal window open in which to enter the commands.
Installing dependencies
^^^^^^^^^^^^^^^^^^^^^^^
Most required dependencies are installed from the
Python Package Index (https://packaging.python.org/installing/)
Python Package Index (https://packaging.python.org/tutorials/installing-packages/)
using the program pip ("PIP Installs Packages"). Besides ``pip``
it is also recommended to install the graphviz package to be
able to visualise dependency graphs. This is optional and the associated
Expand Down
5 changes: 4 additions & 1 deletion src/psyclone/psyir/nodes/dynamic_omp_task_directive.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2022-2023, Science and Technology Facilities Council.
# Copyright (c) 2022-2024, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -126,16 +126,19 @@ class DynamicOMPTaskDirective(OMPTaskDirective):
IntrinsicCall.Intrinsic.ERF,
IntrinsicCall.Intrinsic.EXP,
IntrinsicCall.Intrinsic.FLOOR,
IntrinsicCall.Intrinsic.INT,
IntrinsicCall.Intrinsic.LBOUND,
IntrinsicCall.Intrinsic.LEN,
IntrinsicCall.Intrinsic.LOG,
IntrinsicCall.Intrinsic.LOG10,
IntrinsicCall.Intrinsic.MAX,
IntrinsicCall.Intrinsic.MIN,
IntrinsicCall.Intrinsic.MODULO,
IntrinsicCall.Intrinsic.REAL,
IntrinsicCall.Intrinsic.SIGN,
IntrinsicCall.Intrinsic.SIN,
IntrinsicCall.Intrinsic.SINH,
IntrinsicCall.Intrinsic.SIZE,
IntrinsicCall.Intrinsic.SQRT,
IntrinsicCall.Intrinsic.TAN,
IntrinsicCall.Intrinsic.TANH,
Expand Down
14 changes: 11 additions & 3 deletions src/psyclone/psyir/transformations/omp_task_trans.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2021, Science and Technology Facilities Council.
# Copyright (c) 2021-2024, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -31,16 +31,18 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# Author A. B. G. Chalk STFC Daresbury Lab
# Author A. B. G. Chalk, STFC Daresbury Lab

''' This module provides the OMPTaskTrans transformation.'''

from psyclone.errors import GenerationError
from psyclone.domain.common.transformations import KernelModuleInlineTrans
from psyclone.psyGen import Kern
from psyclone.psyir.transformations.fold_conditional_return_expressions_trans \
import FoldConditionalReturnExpressionsTrans
from psyclone.psyir.transformations.parallel_loop_trans import\
ParallelLoopTrans
from psyclone.psyir.nodes import CodeBlock, Call
from psyclone.psyir.nodes import CodeBlock, Call, IntrinsicCall
from psyclone.psyir.nodes import DynamicOMPTaskDirective
from psyclone.psyir.transformations.inline_trans import InlineTrans
from psyclone.psyir.transformations.transformation_error import \
Expand Down Expand Up @@ -107,6 +109,9 @@ def validate(self, node, options=None):

calls = node_copy.walk(Call)
for call in calls:
# Skip over intrinsic calls as we can't inline them
if isinstance(call, IntrinsicCall):
continue
intrans.validate(call)

def _directive(self, children, collapse=None):
Expand Down Expand Up @@ -159,6 +164,9 @@ def _inline_kernels(self, node):

calls = node.walk(Call)
for call in calls:
# Skip over intrinsic calls as we can't inline them
if isinstance(call, IntrinsicCall):
continue
intrans.apply(call)

def apply(self, node, options=None):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2021-2022, Science and Technology Facilities Council.
# Copyright (c) 2021-2024, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -96,15 +96,17 @@ def test_omptask_validate(fortran_reader):


def test_omptask_apply(fortran_reader, fortran_writer):
''' Test the apply method of the OMPTaskTrans. '''
''' Test the apply method of the OMPTaskTrans. We contain
an IntrinsicCall inside the region to be transformed to ensure that
the application doesn't attempt to inline it. '''
code = '''
subroutine sub()
integer :: ji, jj, n
integer, dimension(10, 10) :: t
integer, dimension(10, 10) :: s
do jj = 1, 10
do ji = 1, 10
t(ji, jj) = s(ji, jj)
do ji = 1, SIZE(ji,2)
t(ji, jj) = INT(s(ji, jj))
end do
end do
end subroutine sub
Expand All @@ -130,8 +132,8 @@ def test_omptask_apply(fortran_reader, fortran_writer):
do jj = 1, 10, 1
!$omp task private(ji), firstprivate(jj), shared(t,s), \
depend(in: s(:,jj)), depend(out: t(:,jj))
do ji = 1, 10, 1
t(ji,jj) = s(ji,jj)
do ji = 1, SIZE(ji, 2), 1
t(ji,jj) = INT(s(ji,jj))
enddo
!$omp end task
enddo
Expand Down

0 comments on commit 98185d0

Please sign in to comment.