generated from GEOS-ESM/geos-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental techincal documentation for NDSL (#86)
* [unrelated] Fix a couple typos and a broken link * NDSL: technical documentation --------- Co-authored-by: Roman Cattaneo <>
- Loading branch information
Showing
4 changed files
with
93 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# NDSL documentation | ||
|
||
A space to keep early prototype technical documentation for the [NASA/NOAA DSL middleware](https://github.com/NOAA-GFDL/NDSL). This will mostly contain early drafts, prototypes, whitepapers, ... since design decisions should be documented (with the code) in the respective repository (e.g. [NDSL](https://github.com/NOAA-GFDL/NDSL) / [DaCe](https://github.com/spcl/dace) / [GT4Py](https://github.com/GridTools/gt4py/)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Improved GT4Py-DaCe bridge | ||
|
||
Issue: <https://github.com/GEOS-ESM/NDSL/issues/53> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<mxfile host="app.diagrams.net" modified="2024-09-03T15:23:55.160Z" agent="Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0" etag="LGh8V0W94z09Tky1XRyW" version="24.3.0" type="device"> | ||
<diagram name="Seite-1" id="uBIzncXjYzNze9gtcR0E"> | ||
<mxGraphModel dx="1033" dy="1082" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> | ||
<root> | ||
<mxCell id="0" /> | ||
<mxCell id="1" parent="0" /> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-39" value="" style="shape=ext;double=1;rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="50" y="750" width="720" height="410" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-35" value="" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="619" y="495" width="176" height="160" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-29" value="" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="352" y="115" width="176" height="160" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-1" value="<div style="font-size: 20px;"><font style="font-size: 20px;">statement0</font></div><div style="font-size: 20px;"><font style="font-size: 20px;">statement1</font></div><div style="font-size: 20px;"><font style="font-size: 20px;"><br></font></div><div style="font-size: 20px;"><font style="font-size: 20px;">if condition:<br></font></div><div style="font-size: 20px;"><font style="font-size: 20px;">&nbsp; statement2</font></div><div style="font-size: 20px;"><font style="font-size: 20px;">&nbsp; statement3</font></div><div style="font-size: 20px;"><font style="font-size: 20px;"><br></font></div><div style="font-size: 20px;"><font style="font-size: 20px;">&nbsp; while condition2:</font></div><div style="font-size: 20px;"><font style="font-size: 20px;">&nbsp;&nbsp;&nbsp; statement4</font></div><div style="font-size: 20px;"><font style="font-size: 20px;">&nbsp;&nbsp;&nbsp; statement5</font></div><div style="font-size: 20px;"><font style="font-size: 20px;"><br></font></div><div style="font-size: 20px;"><font style="font-size: 20px;">&nbsp; statement6</font></div><div style="font-size: 20px;"><font style="font-size: 20px;">&nbsp; statement7</font></div><div style="font-size: 20px;"><font style="font-size: 20px;"><br></font></div><div style="font-size: 20px;"><font style="font-size: 20px;"><font style="font-size: 20px;">statement8</font><font style="font-size: 20px;"><br></font></font></div>" style="whiteSpace=wrap;html=1;aspect=fixed;fontFamily=Courier Prime;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DCourier%2BPrime;align=left;verticalAlign=top;fillColor=#dae8fc;strokeColor=#6c8ebf;opacity=80;" vertex="1" parent="1"> | ||
<mxGeometry x="250" y="331" width="369" height="369" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-5" value="" style="whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;opacity=50;" vertex="1" parent="1"> | ||
<mxGeometry x="270" y="430" width="230" height="230" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-7" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;opacity=70;" vertex="1" parent="1"> | ||
<mxGeometry x="300" y="525" width="240" height="65" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-13" value="" style="shape=crossbar;whiteSpace=wrap;html=1;rounded=1;direction=south;" vertex="1" parent="1"> | ||
<mxGeometry x="90" y="331" width="20" height="369" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-16" value="" style="shape=crossbar;whiteSpace=wrap;html=1;rounded=1;direction=south;" vertex="1" parent="1"> | ||
<mxGeometry x="125" y="410" width="20" height="250" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-17" value="" style="shape=crossbar;whiteSpace=wrap;html=1;rounded=1;direction=south;" vertex="1" parent="1"> | ||
<mxGeometry x="150" y="517.5" width="20" height="80" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-19" value="HorizontalExecution" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"> | ||
<mxGeometry x="140" y="331" width="60" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-20" value="<div>Condition</div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"> | ||
<mxGeometry x="145" y="410" width="60" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-23" value="<div>Loop</div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"> | ||
<mxGeometry x="170" y="517.5" width="60" height="30" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-24" value="<font style="font-size: 24px;" data-font-src="https://fonts.googleapis.com/css?family=Caveat" face="Caveat">statements are evaluated in a Tasklet</font>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"> | ||
<mxGeometry x="380" y="130" width="120" height="130" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-28" value="" style="curved=1;endArrow=classic;html=1;rounded=0;" edge="1" parent="1" source="k6TCTClMSMkHMvDiaAWe-29" target="k6TCTClMSMkHMvDiaAWe-1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="310" y="190" as="sourcePoint" /> | ||
<mxPoint x="330" y="180" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="330" y="230" /> | ||
<mxPoint x="270" y="300" /> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-31" value="" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1"> | ||
<mxGeometry x="540" y="130" width="230" height="180" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-32" value="<font style="font-size: 24px;" face="Caveat">Conditions and Loops translate to nested SDFG</font><font size="3"><br></font>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"> | ||
<mxGeometry x="598" y="155" width="120" height="130" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-33" value="" style="curved=1;endArrow=classic;html=1;rounded=0;exitX=0.55;exitY=0.95;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.488;entryY=0.241;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="k6TCTClMSMkHMvDiaAWe-31" target="k6TCTClMSMkHMvDiaAWe-1"> | ||
<mxGeometry width="50" height="50" relative="1" as="geometry"> | ||
<mxPoint x="680" y="430" as="sourcePoint" /> | ||
<mxPoint x="730" y="380" as="targetPoint" /> | ||
<Array as="points"> | ||
<mxPoint x="580" y="370" /> | ||
<mxPoint x="440" y="380" /> | ||
</Array> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-34" value="<font style="font-size: 24px;" data-font-src="https://fonts.googleapis.com/css?family=Caveat" face="Caveat">each color denotes one </font><font style="font-size: 18px;" face="Courier Prime" data-font-src="https://fonts.googleapis.com/css?family=Courier+Prime">CodeBlock</font><font style="font-size: 24px;" data-font-src="https://fonts.googleapis.com/css?family=Caveat" face="Caveat"><br></font>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"> | ||
<mxGeometry x="650" y="510" width="120" height="130" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="k6TCTClMSMkHMvDiaAWe-36" value="<div align="left"><font style="font-size: 16px;">New things</font></div><div align="left"><font style="font-size: 14px;"><br></font></div><div align="left"><font style="font-size: 14px;"><font data-font-src="https://fonts.googleapis.com/css?family=Courier+Prime" face="Courier Prime">oir.CodeBlock</font> allows to use visitor pattern in daceir_builder. unused in other backends</font></div><div align="left"><font style="font-size: 14px;"><font data-font-src="https://fonts.googleapis.com/css?family=Courier+Prime" face="Courier Prime">dcir.Condition</font> state transitions for conditions (the body is a CodeBlock)<br></font></div><div align="left"><font style="font-size: 14px;"><font data-font-src="https://fonts.googleapis.com/css?family=Courier+Prime" face="Courier Prime">dcir.WhileLoop</font> state transitions for while loops (the body is a CodeBlock)<br></font></div><div align="left"><font style="font-size: 14px;"><br></font></div><div><font style="font-size: 14px;"><br></font></div><div><font size="3">visit_CodeBlock(node: oir.CodeBlock, ...):</font></div><div><font size="3">&nbsp; - acts as a scope for local declarations</font></div><div><font size="3">&nbsp; - separates statements from potential nested CodBlocks</font></div><div><font size="3">&nbsp; - visit statements and potential nested CodeBlocks</font></div><div><font size="3">&nbsp; - wires output from statements to nested CodeBlocks</font></div><div><font size="3">&nbsp; - wires output form nested CodeBlocks to statements at the end of the CodeBlock</font></div><div><font size="3"><br></font></div><div><font size="3">Funny thing about this is that there exists gtir.BlockStmt (used for describing if statements).<br></font></div><div><font size="3">These block statements are then split into single statements as mentioned in [1] because<br>that works best for numpy's where clause.<br><br>[1] https://gridtools.github.io/gt4py/latest/lang_design.html#conditionals<br></font></div>" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"> | ||
<mxGeometry x="80" y="760" width="680" height="370" as="geometry" /> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
</mxfile> |