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

fix[cartesian]: While loops inside conditions #1712

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

romanc
Copy link
Contributor

@romanc romanc commented Oct 25, 2024

Description

This is a follow-up from PR #1630. It combines two things

  1. In oir_to_npir, we fix conditional while loops in numpy backend. After PR 1630 these were stuck under certain conditions. Tests coverage extended.
  2. In gtir_to_oir, we cleaned up the now unused mask parameter, which was pre-PR 1630 needed to pass down the mask information. With PR 1630 we actually removed the need for that parameter to be passed along because we properly nest the nested statements.

Requirements

  • All fixes and/or new features come with corresponding tests.
  • Important design decisions have been documented in the approriate ADR inside the docs/development/ADRs/ folder.

If this PR contains code authored by new contributors please make sure:

  • The PR contains an updated version of the AUTHORS.md file adding the names of all the new contributors.

@romanc romanc changed the title WIP: Clean up now unused mask parameter WIP: refactor[cartesian]: Clean up unused mask parameter in gtir_to_oir pass Oct 25, 2024
@romanc romanc changed the title WIP: refactor[cartesian]: Clean up unused mask parameter in gtir_to_oir pass WIP: refactor[cartesian]: While loops inside conditions Oct 28, 2024
@romanc romanc changed the title WIP: refactor[cartesian]: While loops inside conditions fix[cartesian]: While loops inside conditions Oct 28, 2024
@romanc
Copy link
Contributor Author

romanc commented Oct 28, 2024

/cc @FlorianDeconinck, @twicki feel free to review and/or suggest additional test coverage

Copy link
Contributor

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

LGTM

This comes because the OIR was writing itself as a vector-logic IR (presumably to follow numpy implementation). But now, conditions are properly nested and the vector-way of masking per operation is left to NPIR

@romanc
Copy link
Contributor Author

romanc commented Oct 28, 2024

@egparedes Enrique would you have time to kick off the CSCS test suite and to do another review? Thanks in advance 🙏

@romanc
Copy link
Contributor Author

romanc commented Oct 29, 2024

@twicki please review

@egparedes
Copy link
Contributor

cscs-ci run

@havogt havogt requested a review from twicki November 4, 2024 10:13
Copy link
Contributor

@twicki twicki left a comment

Choose a reason for hiding this comment

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

LGTM,

This removes the extra code that was around combining masks that should now no longer be needed because nesting happens directly.

@romanc
Copy link
Contributor Author

romanc commented Nov 4, 2024

Thanks everybody for their reviews. @egparedes we are happy to merge now whenever is convenient for you.

@egparedes egparedes merged commit 60bb7b1 into GridTools:main Nov 5, 2024
31 checks passed
@romanc romanc deleted the romanc/mask-cleanup branch November 5, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants