Skip to content

Commit

Permalink
More gtfv3 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianDeconinck committed Apr 18, 2024
1 parent 9cf82be commit 5e5a765
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
/@fvdycore
/fvdycore
/fvdycore@
/@gtFV3
/gtFV3
/gtFV3@
__pycache__
/python/@pyFV3
1 change: 1 addition & 0 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The configuration of the dycore is passed via the `FV_Flags` structure/user type
Input control to pyFV3 via environement variables

- `GEOS_PYFV3_BACKEND`: `NDSL` backend for `pyFV3`, defaults to `gt:gpu`
- `GEOS_PYFV3_SINGLE_RANK_OVERRIDE`: boolean to control a single rank override for debug

## Contact

Expand Down
7 changes: 4 additions & 3 deletions python/interface/pyFV3_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(
def finalize(self):
import json

with open("gtfv3_timings.json", "w") as f:
with open("pyfv3_timings.json", "w") as f:
json.dump(self._timings, f, indent=4)

def __call__(
Expand Down Expand Up @@ -149,7 +149,7 @@ def __call__(
diss_est,
)

# Run gtFV3
# Run pyFV3
with TimedCUDAProfiler("Numerics", self._timings):
state_out, self._timings = self.dycore(
self._timings,
Expand Down Expand Up @@ -214,7 +214,8 @@ def __call__(

# Below is the entry point to the interface
# ToDo: we should build the object outside of the sim loop from fortran
# potentially by writing a geos_gtfv3_setup_interface and caching the ptr Fortran side
# potentially by writing a pyfv3_interface_setup and caching the ptr Fortran side
# or by having a central python interpreter object handled by CFFI to register against
WRAPPER = None


Expand Down
6 changes: 3 additions & 3 deletions python/interface/pyFV3_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ def __init__(
)

# Look for an override to run on a single node
gtfv3_single_rank_override = int(os.getenv("GTFV3_SINGLE_RANK_OVERRIDE", -1))
if gtfv3_single_rank_override >= 0:
comm = NullComm(gtfv3_single_rank_override, 6, 42)
single_rank_override = int(os.getenv("GEOS_PYFV3_SINGLE_RANK_OVERRIDE", -1))
if single_rank_override >= 0:
comm = NullComm(single_rank_override, 6, 42)

# Make a custom performance collector for the GEOS wrapper
self.perf_collector = PerformanceCollector("GEOS wrapper", comm)
Expand Down

0 comments on commit 5e5a765

Please sign in to comment.