-
Notifications
You must be signed in to change notification settings - Fork 6
Cartesian Biweekly 2020 11 24
[ ] @Johann D Will make a GDP for looping
[ ] @Oli F @Rhea G will propose changes to the quickstart based on fv3 and student experience
Review of action points of last meeting:
[ ] @Johann D Will make a GDP for looping
[x] @Johann D Will update Regions GDP with new implementation
[ ] @Oli F @Rhea G will propose changes to the quickstart based on fv3 and student experience
- Update 10.11.2020: Unfortunately no progress here. Currently all of our attention is on preparing the 3-day DSL workshop next week.
Materials: https://github.com/VulcanClimateModeling/dsl_workshop
GDP updated: https://github.com/GridTools/gt4py/pull/24 👌 Awaiting review
PR status:
- New interval processing https://github.com/GridTools/gt4py/pull/225 ✅ Merged
- Frontend implementation https://github.com/GridTools/gt4py/pull/227 👌 Awaiting review, thoroughly tested
- Lower to IIR https://github.com/GridTools/gt4py/pull/228 🙈 Ready for initial review, needs a few more tests
- Backend implementations https://github.com/GridTools/gt4py/pull/234 🙈 Ready for initial review, needs a test_suites test, but I can’t figure out how to make validation pass
Get GDP finalized by next Tuesday, then review frontend impl
Current PR: https://github.com/GridTools/gt4py/pull/203
Currently this solves:
- Removes axes of temporary FieldDecls if no dependency in that direction
- Codegen in supported backends
What we still want to do:
- Fix restriction that temporary fields are not reduced if they are accessed in parallel vertical loops (broadcast issues in numpy backend)
- Make compatible with “mask” idea in frontend
- Look at type hint for axes
https://github.com/GridTools/gt4py/pull/264
Todo: check type of eval.i() in GT C++
It seems common, especially in pointwise physics routines, to check if levels are within a range. Example:
Three types of loops seem to recur as motifs:
-
Tracer-like loops: do computation for a set of fields: We agreed we would solve this with a
*args
like argument to stencils -
Do a set of statements a variable number of times: A simple for loop should work for this (we agreed on compile-time upper bound for now)
-
Waterfall loops
for k in range(1, nk):
if ri[k] < ri_ref:
h0 = m[k] * (q[k] - q[k-1])
q[k-1] += h0 / w[k-1]
q[k] -= h0 / w[k]
This type of loop is particularly problematic because it accesses an element again after already setting it. Hence I call this a waterfall loop.
I have shown with sympy that this can be mapped to double for loop: an outer for loop with an inner for loop that goes from current K→end.
Example syntax that could work for this:
with interval(1, None):
k_ind = index(K)
with interval(k_ind, None):
...
Go ahead with GDPs for (2) then (1), delay (3)
Vertical Riemann solver miniapp here:
https://github.com/VulcanClimateModeling/Riem-solver-c-miniapp
+Initial Riem_Solver_C Mini-App Port Notes
Main points relevant to GT4Py:
- SIM1_Solver inlining
- Temporaries across computations
- Need to allow empty computations due to compile-time ifs (PR submitted)
This wiki is automatically updated from https://github.com/GridTools/concepts. See README on how to suggest changes.