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

Changes to test configurations options and externals for parsing #53

Merged
merged 11 commits into from
Jun 20, 2024
1 change: 1 addition & 0 deletions ndsl/dsl/stencil.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ def axis_offsets(
"local_js": gtscript.J[0] + self.jsc - origin[1],
"j_end": j_end,
"local_je": gtscript.J[-1] + self.jec - origin[1] - domain[1] + 1,
"mysign": -1.0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is too aggressive as a fix. The axis_offsets function shouldn't carry the mysign issue.

}

def get_origin_domain(
Expand Down
3 changes: 1 addition & 2 deletions ndsl/stencils/corners.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,6 @@ def fill_corners_dgrid_defn(
x_out: FloatField,
y_in: FloatField,
y_out: FloatField,
mysign: float,
):
"""
Args:
Expand All @@ -998,7 +997,7 @@ def fill_corners_dgrid_defn(
y_in (in):
y_out (inout):
"""
from __externals__ import i_end, i_start, j_end, j_start
from __externals__ import i_end, i_start, j_end, j_start, mysign
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pass it as a default externals or directly a scalar, since never changes in our code


with computation(PARALLEL), interval(...):
# sw corner
Expand Down
8 changes: 4 additions & 4 deletions ndsl/stencils/testing/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def pytest_addoption(parser):
parser.addoption(
"--topology",
action="store",
default="cube-sphere",
help='Topology of the grid. "cube-sphere" means a 6-faced grid, "doubly-periodic" means a 1 tile grid. Default to "cube-sphere".',
default="cubed-sphere",
help='Topology of the grid. "cubed-sphere" means a 6-faced grid, "doubly-periodic" means a 1 tile grid. Default to "cubed-sphere".',
)


Expand Down Expand Up @@ -189,7 +189,7 @@ def get_ranks(metafunc, layout):
if only_rank is None:
if topology == "doubly-periodic":
total_ranks = layout[0] * layout[1]
elif topology == "cube-sphere":
elif topology == "cubed-sphere":
total_ranks = 6 * layout[0] * layout[1]
else:
raise NotImplementedError(f"Topology {topology} is unknown.")
Expand Down Expand Up @@ -370,7 +370,7 @@ def generate_parallel_stencil_tests(metafunc, *, backend: str):


def get_communicator(comm, layout, topology_mode):
if (MPI.COMM_WORLD.Get_size() > 1) and (topology_mode == "doubly-periodic"):
if (MPI.COMM_WORLD.Get_size() > 1) and (topology_mode == "cubed-sphere"):
Copy link

Choose a reason for hiding this comment

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

This change will definitely make a big difference!!

Copy link
Collaborator

Choose a reason for hiding this comment

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

This was a bug I introduce in the PR right before

partitioner = CubedSpherePartitioner(TilePartitioner(layout))
communicator = CubedSphereCommunicator(comm, partitioner)
else:
Expand Down
2 changes: 1 addition & 1 deletion ndsl/stencils/testing/test_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def test_parallel_savepoint(
)
if case.testobj.skip_test:
return
if grid and not case.testobj.compute_grid_option:
if (grid == "compute") and not case.testobj.compute_grid_option:
pytest.xfail(f"Grid compute option not used for test {case.savepoint_name}")
input_data = dataset_to_dict(case.ds_in)
# run python version of functionality
Expand Down
Loading