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

#443 Support flag that triggers fparser to read code in OpenMP conditional sentinels #444

Merged
merged 19 commits into from
Apr 24, 2024

Conversation

hiker
Copy link
Collaborator

@hiker hiker commented Apr 4, 2024

Fixed #443, and is important for FAB to detect dependencies in omp sentinels.

The implementation is (unfortunately) on two different levels:

  1. Fixed format is handled on a line by line basis, since a continued conditional sentinel can be detected with an easy regexp.
  2. Free format continued conditional sentinels can only be reliably detected if the previous line had a conditional sentinel, any simple reg.exp cannot distinguish this from e.g. !$omp (since a '&' and esp. spaces around that are all optional), so it's handled on higher up when combining multiple lines.

Moving the fixed format handling up (to the level where the free format is handled) seems to be more difficult, since free format is handled in many different ways when combining lines (strict format, fixed, f77) - so I opted for the two different levels.

I can confirm that this with changes fab now (when supplying the required optional flag) detects dependencies in conditional omp sentinels.

@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.07%. Comparing base (1259f8a) to head (338bd07).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #444      +/-   ##
==========================================
+ Coverage   91.99%   92.07%   +0.08%     
==========================================
  Files          85       85              
  Lines       13678    13825     +147     
==========================================
+ Hits        12583    12730     +147     
  Misses       1095     1095              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@arporter arporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good Joerg, thanks for adding this.
Mostly small things/renaming/extending tests.
Please could you also update the documentation (I've indicated a suitable location somewhere in the review).

src/fparser/common/readfortran.py Show resolved Hide resolved
src/fparser/common/readfortran.py Show resolved Hide resolved
src/fparser/common/readfortran.py Show resolved Hide resolved
src/fparser/common/readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/readfortran.py Show resolved Hide resolved
src/fparser/common/tests/test_readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/tests/test_readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/tests/test_readfortran.py Show resolved Hide resolved
src/fparser/common/tests/test_readfortran.py Show resolved Hide resolved
src/fparser/common/tests/test_readfortran.py Show resolved Hide resolved
@arporter arporter added reviewed with actions PR has been reviewed and is back with developer and removed under review labels Apr 11, 2024
@hiker
Copy link
Collaborator Author

hiker commented Apr 18, 2024

Ready for next review.

@hiker hiker added ready for review and removed reviewed with actions PR has been reviewed and is back with developer labels Apr 18, 2024
@arporter
Copy link
Member

Hi @hiker, github isn't showing any commits since the last review?

@arporter arporter added reviewed with actions PR has been reviewed and is back with developer and removed under review labels Apr 22, 2024
@hiker
Copy link
Collaborator Author

hiker commented Apr 23, 2024

Dang, yes, I missed that you updated this branch, so my push didn't go through, and I didn't notice. Now something should be there :)

@hiker hiker added ready for review and removed reviewed with actions PR has been reviewed and is back with developer labels Apr 23, 2024
src/fparser/common/readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/readfortran.py Show resolved Hide resolved
src/fparser/common/readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/readfortran.py Outdated Show resolved Hide resolved
Copy link
Member

@arporter arporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there now. Just a few minor things and some weird cases where black has changed a "..." + "..." into "..." "...".
Update doc builds fine.
I've checked on CodeCov and all is well, even if that's not being reported here.

src/fparser/common/readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/tests/test_readfortran.py Outdated Show resolved Hide resolved
src/fparser/common/tests/test_readfortran.py Show resolved Hide resolved
src/fparser/common/tests/test_readfortran.py Show resolved Hide resolved
@arporter arporter added reviewed with actions PR has been reviewed and is back with developer and removed ready for review labels Apr 23, 2024
@hiker
Copy link
Collaborator Author

hiker commented Apr 24, 2024

Ready for next review.

@hiker hiker added ready for review and removed reviewed with actions PR has been reviewed and is back with developer labels Apr 24, 2024
@sergisiso
Copy link
Collaborator

@hiker @arporter and the Codecov status check is working again 🥳 (after we reinstalled the github app). I will close the codecov issue now.

Copy link
Member

@arporter arporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now, thanks for those changes.
Will proceed to merge.

@arporter arporter merged commit 5f24ee2 into master Apr 24, 2024
6 checks passed
@arporter arporter deleted the 443_openmp_sentinels branch April 24, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supporting OpenMP Sentinels
4 participants