stfc / PSyclone

Domain-specific compiler and code transformation system for Finite Difference/Volume/Element Earth-system models in Fortran
BSD 3-Clause "New" or "Revised" License
104 stars 28 forks source link

can_loop_be_parallelised fails if underlying SymbolicMath comparison produce a TypeError #2723

Open sergisiso opened 2 days ago

sergisiso commented 2 days ago

NEMOv5 (-r ORCA2_ICE_PISCES) mppini.f90

fails in the loop_directive_trans.apply(loop) because it calls the dependency tools dtools.can_loop_be_parallelised and this does a symbolic comparison that fails with:

  File "psyclone/core/symbolic_maths.py", line 203, in _subtract
    return simplify(sympy_expressions[0] - sympy_expressions[1])
                    ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'One' and 'tuple'
hiker commented 1 day ago

How is that file pre-processed? And what PSyclone script do you use (and any other command line option that might be required).

ATM I can't even process that file with fparser:

File: 'mppini.F90'
Syntax error: at line 182
>>>     READ_NML_REF(numnam,nammpp)

Looks like I need additional #include files as well (# include "read_nml_substitute.h90" :) ). Could you perhaps just give me the pre-processed file, I don't have a full NEMO environment at hand.