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 uses_icon_grid_with_otf fixture that broke with gt4py#1470 #401

Merged
merged 6 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions model/common/src/icon4py/model/common/test_utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@
from dataclasses import dataclass, field
from typing import ClassVar, Optional

import gt4py.next.program_processors.modular_executor
import numpy as np
import numpy.typing as npt
import pytest
from gt4py._core.definitions import is_scalar_type
from gt4py.next import as_field, common as gt_common, constructors
from gt4py.next.ffront.decorator import Program
from gt4py.next.program_processors.otf_compile_executor import (
CachedOTFCompileExecutor,
OTFCompileExecutor,
)

from ..grid.base import BaseGrid
from ..grid.icon import IconGrid
Expand Down Expand Up @@ -244,7 +241,9 @@ def uses_icon_grid_with_otf(backend, grid):
Is needed to skip certain stencils where the execution domain needs to be restricted or boundary taken into account.
"""
if hasattr(backend, "executor") and isinstance(grid, IconGrid):
if isinstance(backend.executor, (OTFCompileExecutor, CachedOTFCompileExecutor)):
if isinstance(
backend.executor, gt4py.next.program_processors.modular_executor.ModularExecutor
):
return True
try:
from gt4py.next.program_processors.runners import dace_iterator
Expand Down
6 changes: 4 additions & 2 deletions model/common/tests/metric_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# distribution for a copy of the license or check <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-or-later
import gt4py.next.program_processors.modular_executor
import pytest
from gt4py.next.program_processors.otf_compile_executor import OTFCompileExecutor

from icon4py.model.common.test_utils.datatest_fixtures import ( # noqa: F401 # import fixtures from test_utils package
data_provider,
Expand All @@ -37,6 +37,8 @@ def is_otf(backend) -> bool: # noqa : F811 # fixture is used in the test
# - cannot run on embedded: because of slicing
# - roundtrip is very slow on large grid
if hasattr(backend, "executor"):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should not be a fixture but just a function in the common.test_utils module.

Copy link
Contributor

Choose a reason for hiding this comment

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

@halungge I propose to fix this in a separate PR. First I'll fix the icon4py CI.

if isinstance(backend.executor, OTFCompileExecutor):
if isinstance(
backend.executor, gt4py.next.program_processors.modular_executor.ModularExecutor
):
return True
return False
4 changes: 2 additions & 2 deletions spack/gt4py-stable/spack.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
spack:
specs:
- py-icon4py@main%[email protected] ^[email protected].2%[email protected]
- py-icon4py@main%[email protected] ^[email protected].3%[email protected]
view: false
concretizer:
unify: true
develop:
py-icon4py:
spec: py-icon4py@main%[email protected] ^[email protected].2%[email protected]
spec: py-icon4py@main%[email protected] ^[email protected].3%[email protected]
path: ../../
Loading