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

SCCBaseTransformation.get_integer_variable now also checks module imports #279

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

awnawab
Copy link
Contributor

@awnawab awnawab commented Apr 8, 2024

The get_integer_variable utility in SCCBaseTransformation now also checks if the integer has been imported via a module.

Copy link

github-actions bot commented Apr 8, 2024

Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/279/index.html

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.88%. Comparing base (a594b44) to head (47314ba).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #279      +/-   ##
==========================================
- Coverage   92.88%   92.88%   -0.01%     
==========================================
  Files         102      102              
  Lines       18253    18252       -1     
==========================================
- Hits        16954    16953       -1     
  Misses       1299     1299              
Flag Coverage Δ
lint_rules 96.39% <ø> (ø)
loki 92.85% <ø> (ø)
transformations 92.22% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@reuterbal reuterbal added the rebase required Rebase required for the PR branch to resolve conflicts label Apr 10, 2024
Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Thanks, nice find! A question on the test and a suggestion how to maybe save a few cycles in the transformation.

@@ -796,6 +804,9 @@ def test_single_column_coalesced_hoist_openacc(frontend, horizontal, vertical, b
analysis = HoistTemporaryArraysAnalysis(dim_vars=(vertical.size,))
synthesis = SCCHoistTemporaryArraysTransformation(block_dim=blocking)

# Check that blocking size has not been redefined
assert driver.symbol_map[blocking.size].type.module
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this missing some kind of comparison maybe? E.g., driver.symbol_map[blocking.size].type.module.lower() == 'block_dim_mod'?

Comment on lines 119 to 121
if name in routine.symbol_map:
v_index = routine.symbol_map[name]
else:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since constructing these maps is expensive, could we maybe do it like this?

Suggested change
if name in routine.symbol_map:
v_index = routine.symbol_map[name]
else:
v_index = routine.symbol_map.get(name)
if v_index is None:

@reuterbal reuterbal removed the rebase required Rebase required for the PR branch to resolve conflicts label Apr 12, 2024
Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Many thanks, I think this is uncontroversial and good to go!

@reuterbal reuterbal added the ready for merge This PR has been approved and is ready to be merged label Apr 12, 2024
@mlange05
Copy link
Collaborator

Confirmed clean with ec-physics.

@reuterbal reuterbal merged commit 2e80d17 into main Apr 12, 2024
12 checks passed
@reuterbal reuterbal deleted the naan-get-integer branch April 12, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for merge This PR has been approved and is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants