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

bug[next]: Fix codegen in gtfn for unused vertical offset provider #1746

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nfarabullini
Copy link
Contributor

@nfarabullini nfarabullini commented Nov 25, 2024

Providing an offest provider for a vertical dimension without using that dimension in a program, e.g. no arguments are fields defined on K, resulting in erroneous C++ code.

@nfarabullini nfarabullini marked this pull request as draft November 25, 2024 08:03
@nfarabullini nfarabullini marked this pull request as ready for review November 25, 2024 09:49
@nfarabullini nfarabullini changed the title small kdim fix bug [next]: small kdim fix Nov 25, 2024
@havogt
Copy link
Contributor

havogt commented Nov 25, 2024

Let's add a test, it's not obvious to me how to trigger that bug.

@@ -229,6 +229,7 @@ def simple_mesh() -> MeshDescriptor:
C2E.value: gtx.NeighborTableOffsetProvider(
c2e_arr, Cell, Edge, 4, has_skip_values=False
),
Koff.value: KDim,
Copy link
Contributor

@havogt havogt Nov 25, 2024

Choose a reason for hiding this comment

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

Why is this change here? I don't understand how this is related. Is it required to make the test below fail before the fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is an easy way to trigger the error.

Copy link
Contributor

Choose a reason for hiding this comment

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

But not the best I guess. An isolated test would be one that has an Cartesian offset for a dimension that is not in any field?

Copy link

Choose a reason for hiding this comment

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

any updates on this? I would need it for C2SM/icon4py#564

@tehrengruber tehrengruber changed the title bug [next]: small kdim fix bug[next]: Fix codegen in gtfn for unused vertical offset provider Nov 28, 2024
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