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

pragma region attach bug #427

Closed
ecossevin opened this issue Nov 5, 2024 · 5 comments · Fixed by #431
Closed

pragma region attach bug #427

ecossevin opened this issue Nov 5, 2024 · 5 comments · Fixed by #431
Labels
bug Something isn't working

Comments

@ecossevin
Copy link

What happened?

When I do with pragma region attach with NAME=CPTEND in the pragma, the pragma region isn't created.

What are the steps to reproduce the bug?

SUBROUTINE TEST()
IMPLICIT NONE
!$loki parallel PARALLEL, TARGET=OpenMP/OpenMPSingleColumn/OpenACCSingleColumn,NAME=CPTEND_NEW
!$loki end parallel
!$loki parallel PARALLEL, TARGET=OpenMP/OpenMPSingleColumn/OpenACCSingleColumn,NAME=CPTEND
!$loki end parallel
!$loki parallel PARALLEL, TARGET=OpenMP/OpenMPSingleColumn/OpenACCSingleColumn,NAME=ACNEBCOND
!$loki end parallel
!$loki parallel PARALLEL, TARGET=OpenMP/OpenMPSingleColumn/OpenACCSingleColumn,NAME=CPTEND
!$loki end parallel
!$loki parallel PARALLEL, TARGET=OpenMP/OpenMPSingleColumn/OpenACCSingleColumn,NAME=TOTO
!$loki end parallel
END SUBROUTINE TEST

from loki import *
src_file = "sub.F90"
src_name = "TEST"
source = Sourcefile.from_file(src_file)
routine = source[src_name]

with pragma_regions_attached(routine):
print(routine.body.body)
breakpoint()

Version

0.2.7 Latest

Platform (OS and architecture)

Linux pxdesrtls020 6.8.0-47-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct 2 16:16:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Relevant log output

(loki_env) (base) [cossevine@taranislogin0 pragma 08:50:39]$ python3 test.py 
[Loki::Sourcefile] Constructed from sub.F90 in 0.03s
(Pragma:: loki parallel PARA..., Pragma:: loki end parallel, Pragma:: loki parallel PARA..., Pragma:: loki end parallel, PragmaRegion::, Pragma:: loki parallel PARA..., Pragma:: loki end parallel, PragmaRegion::)
> /home/gmap/mrpm/cossevine/bug_loki/pragma/test.py(7)<module>()
-> with pragma_regions_attached(routine):


Pragma:: loki parallel PARA..., Pragma:: loki end parallel, SHOULD BE PragmaRegion::

Accompanying data

No response

Organisation

No response

@ecossevin ecossevin added the bug Something isn't working label Nov 5, 2024
@mlange05
Copy link
Collaborator

mlange05 commented Nov 5, 2024

Hi @ecossevin , many thanks for this. This looks a lot like a problem I've recently fixes in this commit:
2f9b51d

Have you confirmed this is still a problem with either v0.2.7 or latest main?

@ecossevin
Copy link
Author

Yes I did a pip install of loki to have the newest version. Is there a command to check the version of loki ?

@mlange05
Copy link
Collaborator

mlange05 commented Nov 7, 2024

Hi, can you please try what you get for python -c "import loki; print(loki.__version__)"?

Since loki is still distributed via git checkouts, you might also have to do something like

cd <loki>
git checkout v0.2.7
pip install -e .
python -c "import loki; print(loki.__version__)"

@ecossevin
Copy link
Author

(loki) (base) [cossevine@taranislogin0 loki 10:54:42]$ python -c "import loki; print(loki.__version__)"
0.2.8.dev182+gb833fef1

@mlange05
Copy link
Collaborator

mlange05 commented Nov 7, 2024

Hi @ecossevin , apologies, I've just looked at this in a little more detail, and I had already fixed this in one of my dev branches, but hadn't submitted the fix yet. I've just filed the fix as PR #431. Could you please confirm that this fixes your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants