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

Unprotected symbol-table merge in InlineTrans #2845

Open
arporter opened this issue Jan 13, 2025 · 1 comment
Open

Unprotected symbol-table merge in InlineTrans #2845

arporter opened this issue Jan 13, 2025 · 1 comment
Labels
bug NG-ARCH Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH

Comments

@arporter
Copy link
Member

After performing inlining, we finally merge the symbol table of the local scope with that of the parent routine. This merge is not protected by a try...except so if it fails, PSyclone crashes:

if ancestor_table is not scope.symbol_table:
ancestor_table.merge(scope.symbol_table)
replacement = type(scope.symbol_table)()
scope.symbol_table.detach()
replacement.attach(scope)

Reproducer: psyclone -s examples/nemo/scripts/acc_kernels_trans.py ./icethd_sal.f90

@arporter
Copy link
Member Author

We can workaround this by adding "ice_par" and "ice1d" to RESOLVE_IMPORTS in acc_kernels_trans. However, the bug remains. We could catch it and suggest this solution to the user...

@arporter arporter added the NG-ARCH Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH label Jan 13, 2025
arporter added a commit that referenced this issue Jan 13, 2025
@arporter arporter added the bug label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 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