Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ability to expand array accesses to full range accesses when we have an elemental function #2875

Open
LonelyCat124 opened this issue Jan 28, 2025 · 0 comments
Labels
enhancement NG-ARCH Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH

Comments

@LonelyCat124
Copy link
Collaborator

Currently we create a Codeblock for WHERE accesses like Rob found in UKCA:

WHERE(ABS(pivot) < min_pivot) pivot = min_pivot)

Since we have information on the Intrinsic (and non-intrisic call, which currently behaves wrong) on the is_elemental status, we can do better.

The basic idea of this fix is to modify fparser2.py line 4396 onwards to do:

            is_elemental = intrinsic_ancestor is not None and intrinsic_ancestor.is_elemental
            if (isinstance(ref.symbol, DataSymbol) and
                 (not intrinsic_ancestor or (intrinsic_ancestor and is_elemental))):

We should also be careful, and if is_elemental is None we should still create a codeblock, as in that case we don't know the status of the is_elemental result so its not safe for us to turn the WHERE statement into a Loop.

@LonelyCat124 LonelyCat124 added enhancement NG-ARCH Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement NG-ARCH Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH
Projects
None yet
Development

No branches or pull requests

1 participant