Open dhaumont opened 5 days ago
Thanks. Could you add a small Fortran reproducer for this?
@reuterbal Yes, I am working on the reproducer. Coming soon...
cray_pointer.tar.gz @reuterbal Here is the reproducer
Thanks. Slightly modified this to a pytest reproducing the issue:
@pytest.mark.parametrize('frontend', available_frontends())
def test_cray_pointers(frontend):
fcode = """
SUBROUTINE SUBROUTINE_WITH_CRAY_POINTER (KLON,KLEV)
IMPLICIT NONE
INTEGER, INTENT(IN) :: KLON, KLEV
REAL, DIMENSION(KLON,KLEV) :: ZQ
POINTER (IP_ZQ, ZQ)
END SUBROUTINE
""".strip()
routine = Subroutine.from_source(fcode, frontend=frontend)
For this, the frontends produce the following:
line 5: compiler error: compile_statement1: not implemented yet (F-compile.c:747)\n
<declaration col_begin="0" col_end="20" line_begin="5" line_end="5">
<cray-pointer-assoc-list__begin addendum="list-begin" rule="541000" />
<cray-pointer-assoc col_begin="9" col_end="18" line_begin="5" line_end="5" pointee="ZQ" pointer="IP_ZQ" rule="541000" />
<cray-pointer-assoc-list addendum="list" count="1" rule="541000" />
<cray-pointer-stmt col_begin="0" col_end="20" eos=" " keyword="POINTER" line_begin="5" line_end="5" rule="540000" />
<specification-stmt rule="212" />
</declaration>
Cray_Pointer_Stmt('POINTER', Cray_Pointer_Decl_List(',', (Cray_Pointer_Decl(Name('IP_ZQ'), Name('ZQ')),)))
As a quick fix, I will implement representing the pointer statement as an Intrinsic
node for OFP and Fparser.
Thanks Balthasar, the reproducer looks much better like that. I will be happy with the workaround, please tell me when it will be available.
A fix has been implemented in aea722fd60fa67d0e34fd9bdc161a566ca615fce and filed as a PR. It may take a little while until this lands on the main branch but feel free to test this in the meantime.
Parsing files containing Cray pointers output this error:
The message indicates that the fparser frontend successfully parsed the statements as Cray Pointer statements but the translation into a Loki IR failed because there is no representation for them in Loki.