Skip to content

Commit ebde227

Browse files
author
MFC Action
committed
Docs @ 389c0b8
1 parent e9e7a96 commit ebde227

81 files changed

Lines changed: 5270 additions & 5141 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎documentation/architecture.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ <h1 class="doxsection"><a class="anchor" id="autotoc_md13"></a>
429429
<li><b>Add the module to <span class="tt">docs/module_categories.json</span></b> so it appears in this page</li>
430430
</ol>
431431
<p>Follow the pattern of existing modules like <span class="tt">m_body_forces</span> (simple) or <span class="tt">m_viscous</span> (more involved) as a template.</p>
432-
<div style="text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;">Page last updated: 2026-09-18</div> </div></div><!-- contents -->
432+
<div style="text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;">Page last updated: 2026-09-19</div> </div></div><!-- contents -->
433433
</div><!-- PageDoc -->
434434
</div><!-- doc-content -->
435435
<div id="page-nav" class="page-nav-panel">

‎documentation/case_constraints.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ <h2 class="doxsection"><a class="anchor" id="physics-warnings"></a>
16171617
</table>
16181618
<hr />
16191619
<p>💡 <b>Tip:</b> If you encounter a validation error, check the relevant section above or review <a href="https://github.com/MFlowCode/MFC/blob/master/toolchain/mfc/case_validator.py"><span class="tt">case_validator.py</span></a> for complete validation logic.</p>
1620-
<div style="text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;">Page last updated: 2026-09-18</div> </div></div><!-- contents -->
1620+
<div style="text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;">Page last updated: 2026-09-19</div> </div></div><!-- contents -->
16211621
</div><!-- PageDoc -->
16221622
</div><!-- doc-content -->
16231623
<div id="page-nav" class="page-nav-panel">

‎documentation/cli-reference.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md80"></a>
991991
<h3 class="doxsection"><a class="anchor" id="autotoc_md81"></a>
992992
Debug Logging (<span class="tt">-d, --debug-log</span>)</h3>
993993
<p>Enables debug logging for the Python toolchain (mfc.sh internals). This is for troubleshooting the build system, not the MFC simulation code.</p>
994-
<div style="text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;">Page last updated: 2026-09-18</div> </div></div><!-- contents -->
994+
<div style="text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;">Page last updated: 2026-09-19</div> </div></div><!-- contents -->
995995
</div><!-- PageDoc -->
996996
</div><!-- doc-content -->
997997
<div id="page-nav" class="page-nav-panel">

‎documentation/doxygen_crawl.html‎

Lines changed: 102 additions & 97 deletions
Large diffs are not rendered by default.

‎documentation/examples.html‎

Lines changed: 135 additions & 90 deletions
Large diffs are not rendered by default.

‎documentation/expectedPerformance.html‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@
157157
<div class="headertitle"><div class="title">Performance </div></div>
158158
</div><!--header-->
159159
<div class="contents">
160-
<div class="textblock"><h1 class="doxsection"><a class="anchor" id="autotoc_md323"></a>
160+
<div class="textblock"><h1 class="doxsection"><a class="anchor" id="autotoc_md328"></a>
161161
Performance</h1>
162162
<p>This page covers how to achieve maximum performance with MFC, including optimization techniques and benchmark results across various hardware platforms.</p>
163163
<hr />
164-
<h2 class="doxsection"><a class="anchor" id="autotoc_md325"></a>
164+
<h2 class="doxsection"><a class="anchor" id="autotoc_md330"></a>
165165
Achieving Maximum Performance</h2>
166-
<h3 class="doxsection"><a class="anchor" id="autotoc_md326"></a>
166+
<h3 class="doxsection"><a class="anchor" id="autotoc_md331"></a>
167167
Case Optimization (Recommended)</h3>
168168
<p>The single most impactful optimization is <b>case optimization</b>, which can provide <b>up to 10x speedup</b> for both CPU and GPU runs.</p>
169169
<p>Case optimization works by hard-coding your simulation parameters at compile time, enabling aggressive compiler optimizations (loop unrolling, constant propagation, dead code elimination).</p>
@@ -177,7 +177,7 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md326"></a>
177177
<p><b>For batch jobs:</b> </p><div class="fragment"><div class="line">./mfc.sh run case.py --case-optimization -j 8 -e batch -N 4 -n 8</div>
178178
</div><!-- fragment --><p><b>Build separately (optional):</b> </p><div class="fragment"><div class="line">./mfc.sh build -i case.py --case-optimization -j 8</div>
179179
<div class="line">./mfc.sh run case.py</div>
180-
</div><!-- fragment --><h4 class="doxsection"><a class="anchor" id="autotoc_md327"></a>
180+
</div><!-- fragment --><h4 class="doxsection"><a class="anchor" id="autotoc_md332"></a>
181181
When to use case optimization</h4>
182182
<table class="markdownTable">
183183
<tr class="markdownTableHead">
@@ -193,7 +193,7 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md326"></a>
193193
<tr class="markdownTableRowOdd">
194194
<td class="markdownTableBodyNone">Parameter sweeps </td><td class="markdownTableBodyNone">No (many different configurations) </td></tr>
195195
</table>
196-
<h3 class="doxsection"><a class="anchor" id="autotoc_md328"></a>
196+
<h3 class="doxsection"><a class="anchor" id="autotoc_md333"></a>
197197
Other Optimization Flags</h3>
198198
<table class="markdownTable">
199199
<tr class="markdownTableHead">
@@ -205,15 +205,15 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md328"></a>
205205
<tr class="markdownTableRowOdd">
206206
<td class="markdownTableBodyNone"><span class="tt">--fastmath</span> </td><td class="markdownTableBodyNone">Faster (less precise) floating-point math </td></tr>
207207
</table>
208-
<h3 class="doxsection"><a class="anchor" id="autotoc_md329"></a>
208+
<h3 class="doxsection"><a class="anchor" id="autotoc_md334"></a>
209209
Profiling for Optimization</h3>
210210
<p>Use profiling tools to identify bottlenecks:</p>
211211
<p><b>NVIDIA GPUs:</b> </p><div class="fragment"><div class="line">./mfc.sh run case.py --nsys # Timeline profiling (Nsight Systems)</div>
212212
<div class="line">./mfc.sh run case.py --ncu # Kernel profiling (Nsight Compute)</div>
213213
</div><!-- fragment --><p><b>AMD GPUs:</b> </p><div class="fragment"><div class="line">./mfc.sh run case.py --rsys # Timeline profiling (rocprof-systems)</div>
214214
<div class="line">./mfc.sh run case.py --rcu # Kernel profiling (rocprof-compute)</div>
215215
</div><!-- fragment --><p>See <a class="el" href="running.html" title="Running">Running</a> for detailed profiling instructions.</p>
216-
<h3 class="doxsection"><a class="anchor" id="autotoc_md330"></a>
216+
<h3 class="doxsection"><a class="anchor" id="autotoc_md335"></a>
217217
Performance Checklist</h3>
218218
<p>Before running large simulations:</p>
219219
<ol type="1">
@@ -224,10 +224,10 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md330"></a>
224224
<li><b>Profile first:</b> Run a short simulation with profiling to identify issues</li>
225225
</ol>
226226
<hr />
227-
<h2 class="doxsection"><a class="anchor" id="autotoc_md332"></a>
227+
<h2 class="doxsection"><a class="anchor" id="autotoc_md337"></a>
228228
Benchmark Results</h2>
229229
<p>MFC has been benchmarked on several CPUs and GPU devices. This section summarizes these results.</p>
230-
<h3 class="doxsection"><a class="anchor" id="autotoc_md333"></a>
230+
<h3 class="doxsection"><a class="anchor" id="autotoc_md338"></a>
231231
Figure of merit: Grind time performance</h3>
232232
<p>The following table outlines observed performance as nanoseconds per grid point (ns/gp) per equation (eq) per right-hand side (rhs) evaluation (lower is better), also known as the grind time. We solve an example 3D, inviscid, 5-equation model problem with two advected species (8 PDEs) and 8M grid points (158-cubed uniform grid). The numerics are WENO5 finite volume reconstruction and HLLC approximate Riemann solver. This case is located in <span class="tt">examples/3D_performance_test</span>. You can run it via <span class="tt">./mfc.sh run -n &lt;num_processors&gt; -j $(nproc) ./examples/3D_performance_test/case.py -t pre_process simulation --case-optimization</span> for CPU cases right after building MFC, which will build an optimized version of the code for this case then execute it. For benchmarking GPU devices, you will likely want to use <span class="tt">-n &lt;num_gpus&gt;</span> where <span class="tt">&lt;num_gpus&gt;</span> should likely be <span class="tt">1</span>. If the above does not work on your machine, see the rest of this documentation for other ways to use the <span class="tt">./mfc.sh run</span> command.</p>
233233
<p>Results are for MFC v4.9.3 (July 2024 release), though numbers have not changed meaningfully since then. Similar performance is also seen for other problem configurations, such as the Euler equations (4 PDEs). All results are for the compiler that gave the best performance. Note:</p><ul>
@@ -341,38 +341,38 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md333"></a>
341341
<td class="markdownTableBodyRight">Fujitsu A64FX </td><td class="markdownTableBodyRight">Arm </td><td class="markdownTableBodyRight">CPU </td><td class="markdownTableBodyRight">48 cores </td><td class="markdownTableBodyRight">63 </td><td class="markdownTableBodyLeft">GNU 13.2.0 </td><td class="markdownTableBodyLeft">SBU Ookami </td></tr>
342342
</table>
343343
<p><b>All grind times are in nanoseconds (ns) per grid point (gp) per equation (eq) per right-hand side (rhs) evaluation, so X ns/gp/eq/rhs. Lower is better.</b></p>
344-
<h2 class="doxsection"><a class="anchor" id="autotoc_md334"></a>
344+
<h2 class="doxsection"><a class="anchor" id="autotoc_md339"></a>
345345
Weak scaling</h2>
346346
<p>Weak scaling results are obtained by increasing the problem size with the number of processes so that work per process remains constant.</p>
347-
<h3 class="doxsection"><a class="anchor" id="autotoc_md335"></a>
347+
<h3 class="doxsection"><a class="anchor" id="autotoc_md340"></a>
348348
GPU weak scaling</h3>
349349
<p>MFC weak scales on multiple exascale GPU platforms with high efficiency:</p><ul>
350350
<li><b>LLNL El Capitan</b>: AMD MI300A APUs</li>
351351
<li><b>OLCF Frontier</b>: AMD MI250X GPUs (65,536 GCDs, 87% of the machine, 96% efficiency)</li>
352352
<li><b>CSCS Alps</b>: NVIDIA GH200 GPUs</li>
353353
</ul>
354354
<p><img src="../res/weakScaling/weakscaling-dark.png" alt="" style="width:60%; border-radius: 10pt" class="inline"/></p>
355-
<h3 class="doxsection"><a class="anchor" id="autotoc_md336"></a>
355+
<h3 class="doxsection"><a class="anchor" id="autotoc_md341"></a>
356356
NVIDIA V100 GPU (historical)</h3>
357357
<p>MFC weak scales to (at least) 13,824 NVIDIA V100 GPUs on OLCF Summit with 97% efficiency. This corresponds to 50% of the entire machine.</p>
358358
<p><img src="../res/weakScaling/summit.svg" alt="" style="height: 50%; width:50%; border-radius: 10pt pointer-events: none;" class="inline"/></p>
359-
<h3 class="doxsection"><a class="anchor" id="autotoc_md337"></a>
359+
<h3 class="doxsection"><a class="anchor" id="autotoc_md342"></a>
360360
IBM Power9 CPU (historical)</h3>
361361
<p>MFC weak scales to 13,824 Power9 CPU cores on OLCF Summit to within 1% of ideal scaling.</p>
362362
<p><img src="../res/weakScaling/cpuScaling.svg" alt="" style="height: 50%; width:50%; border-radius: 10pt pointer-events: none;" class="inline"/></p>
363-
<h2 class="doxsection"><a class="anchor" id="autotoc_md338"></a>
363+
<h2 class="doxsection"><a class="anchor" id="autotoc_md343"></a>
364364
Strong scaling</h2>
365365
<p>Strong scaling results are obtained by keeping the problem size constant and increasing the number of processes so that work per process decreases.</p>
366-
<h3 class="doxsection"><a class="anchor" id="autotoc_md339"></a>
366+
<h3 class="doxsection"><a class="anchor" id="autotoc_md344"></a>
367367
NVIDIA V100 GPU</h3>
368368
<p>The base case utilizes 8 GPUs with one MPI process per GPU for these tests. The performance is analyzed at two problem sizes: 16M and 64M grid points. The "base case" uses 2M and 8M grid points per process.</p>
369-
<h4 class="doxsection"><a class="anchor" id="autotoc_md340"></a>
369+
<h4 class="doxsection"><a class="anchor" id="autotoc_md345"></a>
370370
16M Grid Points</h4>
371371
<p><img src="../res/strongScaling/strongScaling16.svg" alt="" style="width: 50%; border-radius: 10pt pointer-events: none;" class="inline"/></p>
372-
<h4 class="doxsection"><a class="anchor" id="autotoc_md341"></a>
372+
<h4 class="doxsection"><a class="anchor" id="autotoc_md346"></a>
373373
64M Grid Points</h4>
374374
<p><img src="../res/strongScaling/strongScaling64.svg" alt="" style="width: 50%; border-radius: 10pt pointer-events: none;" class="inline"/></p>
375-
<h3 class="doxsection"><a class="anchor" id="autotoc_md342"></a>
375+
<h3 class="doxsection"><a class="anchor" id="autotoc_md347"></a>
376376
IBM Power9 CPU</h3>
377377
<p>CPU strong scaling tests are done with problem sizes of 16, 32, and 64M grid points, with the base case using 2, 4, and 8M cells per process.</p>
378378
<p><img src="../res/strongScaling/cpuStrongScaling.svg" alt="" style="width: 50%; border-radius: 10pt pointer-events: none;" class="inline"/></p>

‎documentation/getting-started.html‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@
157157
<div class="headertitle"><div class="title">Getting Started </div></div>
158158
</div><!--header-->
159159
<div class="contents">
160-
<div class="textblock"><h1 class="doxsection"><a class="anchor" id="autotoc_md343"></a>
160+
<div class="textblock"><h1 class="doxsection"><a class="anchor" id="autotoc_md348"></a>
161161
Getting Started</h1>
162-
<h2 class="doxsection"><a class="anchor" id="autotoc_md344"></a>
162+
<h2 class="doxsection"><a class="anchor" id="autotoc_md349"></a>
163163
Fetching MFC</h2>
164164
<p>You can either download MFC's <a href="https://github.com/MFlowCode/MFC/releases/latest">latest release from GitHub</a> or clone the repository:</p>
165165
<div class="fragment"><div class="line">git clone https://github.com/MFlowCode/MFC.git</div>
166166
<div class="line">cd MFC</div>
167-
</div><!-- fragment --><h2 class="doxsection"><a class="anchor" id="autotoc_md345"></a>
167+
</div><!-- fragment --><h2 class="doxsection"><a class="anchor" id="autotoc_md350"></a>
168168
Install via Homebrew (macOS)</h2>
169169
<p>On macOS, install prebuilt MFC via Homebrew:</p>
170170
<div class="fragment"><div class="line">brew install mflowcode/mfc/mfc</div>
@@ -179,7 +179,7 @@ <h2 class="doxsection"><a class="anchor" id="autotoc_md344"></a>
179179
<li>The package bundles a Python venv and prebuilt binaries; no additional setup is required.</li>
180180
<li>Examples are installed at <span class="tt">$(brew --prefix mfc)/examples/</span>.</li>
181181
</ul>
182-
<h2 class="doxsection"><a class="anchor" id="autotoc_md346"></a>
182+
<h2 class="doxsection"><a class="anchor" id="autotoc_md351"></a>
183183
Build Environment</h2>
184184
<p>MFC can be built in multiple ways on various operating systems. Please select your desired configuration from the list below:</p>
185185
<h2>*nix</h2>
@@ -251,7 +251,7 @@ <h2>Windows</h2>
251251
</div><!-- fragment --><p>They will download the dependencies MFC requires to build itself.</p>
252252
<p></p>
253253
</details>
254-
<h2 class="doxsection"><a class="anchor" id="autotoc_md347"></a>
254+
<h2 class="doxsection"><a class="anchor" id="autotoc_md352"></a>
255255
Building MFC</h2>
256256
<p>MFC can be built with support for various (compile-time) features:</p>
257257
<table class="markdownTable">
@@ -281,24 +281,24 @@ <h2 class="doxsection"><a class="anchor" id="autotoc_md347"></a>
281281
<li>Build MFC using a single thread without MPI, GPU, and Debug support: <span class="tt">./mfc.sh build --no-mpi</span>.</li>
282282
<li>Build MFC's <span class="tt">simulation</span> code in Debug mode with MPI and GPU support: <span class="tt">./mfc.sh build --debug --gpu -t simulation</span>.</li>
283283
</ul>
284-
<h2 class="doxsection"><a class="anchor" id="autotoc_md348"></a>
284+
<h2 class="doxsection"><a class="anchor" id="autotoc_md353"></a>
285285
Using Containers</h2>
286286
<p>Instead of building MFC from scratch, you can use containers to quickly access a pre-built version of MFC and its dependencies. In brief, you can run the latest MFC container: </p><div class="fragment"><div class="line">docker run -it --rm --entrypoint bash sbryngelson/mfc:latest-cpu</div>
287287
</div><!-- fragment --><p> Please refer to the <a class="el" href="docker.html" title="Containers">Docker</a> document for more information.</p>
288-
<h2 class="doxsection"><a class="anchor" id="autotoc_md349"></a>
288+
<h2 class="doxsection"><a class="anchor" id="autotoc_md354"></a>
289289
Running the Test Suite</h2>
290290
<p>Run MFC's test suite with 8 threads: </p><div class="fragment"><div class="line">./mfc.sh test -j 8</div>
291291
</div><!-- fragment --><p>Please refer to the <a class="el" href="testing.html" title="Testing">Testing</a> document for more information.</p>
292-
<h2 class="doxsection"><a class="anchor" id="autotoc_md350"></a>
292+
<h2 class="doxsection"><a class="anchor" id="autotoc_md355"></a>
293293
Running an Example Case</h2>
294294
<p>MFC has example cases in the <span class="tt">examples</span> folder. You can run such a case interactively using 2 tasks by typing:</p>
295295
<div class="fragment"><div class="line">./mfc.sh run examples/2D_shockbubble/case.py -n 2</div>
296296
</div><!-- fragment --><p>Please refer to the <a class="el" href="running.html" title="Running">Running</a> document for more information on <span class="tt">case.py</span> files and how to run them.</p>
297-
<h2 class="doxsection"><a class="anchor" id="autotoc_md351"></a>
297+
<h2 class="doxsection"><a class="anchor" id="autotoc_md356"></a>
298298
Units and Dimensions</h2>
299299
<p>MFC is <b>unit-agnostic</b>: the solver performs no internal unit conversions. Whatever units you provide for initial conditions, boundary conditions, and material properties, the same units appear in the output.</p>
300300
<p>The only requirement is <b>consistency</b> — all inputs must use the same unit system. Note that some parameters use <b>transformed stored forms</b> rather than standard physical values (e.g., <span class="tt">gamma</span> expects \(1/(\gamma-1)\), not \(\gamma\) itself). See <a class="el" href="equations.html#sec-stored-forms" title="Stored Parameter Conventions">Stored Parameter Conventions</a> for details.</p>
301-
<h2 class="doxsection"><a class="anchor" id="autotoc_md352"></a>
301+
<h2 class="doxsection"><a class="anchor" id="autotoc_md357"></a>
302302
Visualizing Results</h2>
303303
<p>After running post_process, visualize the output directly from the command line:</p>
304304
<div class="fragment"><div class="line"># List available variables</div>
@@ -310,20 +310,20 @@ <h2 class="doxsection"><a class="anchor" id="autotoc_md352"></a>
310310
<div class="line"># Generate a video</div>
311311
<div class="line">./mfc.sh viz examples/2D_shockbubble/ --var pres --step all --mp4</div>
312312
</div><!-- fragment --><p>Output images and videos are saved to the <span class="tt">viz/</span> subdirectory of the case. For more options, see <a class="el" href="visualization.html" title="Flow visualization">Flow Visualization</a> or run <span class="tt">./mfc.sh viz -h</span>.</p>
313-
<h2 class="doxsection"><a class="anchor" id="autotoc_md353"></a>
313+
<h2 class="doxsection"><a class="anchor" id="autotoc_md358"></a>
314314
Helpful Tools</h2>
315-
<h3 class="doxsection"><a class="anchor" id="autotoc_md354"></a>
315+
<h3 class="doxsection"><a class="anchor" id="autotoc_md359"></a>
316316
Parameter Lookup</h3>
317317
<p>MFC has over 3,000 case parameters. Use the <span class="tt">params</span> command to search and explore them:</p>
318318
<div class="fragment"><div class="line">./mfc.sh params dt # Search for parameters matching &quot;dt&quot;</div>
319319
<div class="line">./mfc.sh params -d dt # Show parameter with description</div>
320320
<div class="line">./mfc.sh params patch # Find all patch-related parameters</div>
321321
<div class="line">./mfc.sh params --family # List all parameter families</div>
322-
</div><!-- fragment --><h3 class="doxsection"><a class="anchor" id="autotoc_md355"></a>
322+
</div><!-- fragment --><h3 class="doxsection"><a class="anchor" id="autotoc_md360"></a>
323323
Creating a New Case</h3>
324324
<p>Generate a case file template to get started quickly:</p>
325325
<div class="fragment"><div class="line">./mfc.sh new my_case.py # Create a new case file from template</div>
326-
</div><!-- fragment --><h3 class="doxsection"><a class="anchor" id="autotoc_md356"></a>
326+
</div><!-- fragment --><h3 class="doxsection"><a class="anchor" id="autotoc_md361"></a>
327327
Shell Completion</h3>
328328
<p>Enable tab-completion for <span class="tt">./mfc.sh</span> commands:</p>
329329
<p><b>Bash</b> (add to <span class="tt">~/.bashrc</span>): </p><div class="fragment"><div class="line">source /path/to/MFC/toolchain/completions/mfc.bash</div>

0 commit comments

Comments
 (0)