GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — MFlowCode.github.io/documentation/docker.html at master · MFlowCode/MFlowCode.github.io Expand file tree/ Copy pathdocker.htmlMore file actions 299 lines (297 loc) · 17.5 KB / Copy pathdocker.htmlFile metadata and controls299 lines (297 loc) · 17.5 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 <!-- HTML header for doxygen 1.9.1--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-SY496B9L99"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-SY496B9L99'); </script> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.16.1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>MFC: Containers</title> <meta name="description" content="Containers — MFC documentation. Open-source exascale multiphase flow solver." /> <meta name="keywords" content="exascale, fluid dynamics, cfd, computational fluid dynamics, compressible, hpc, bryngelson, colonius, subgrid, multiphase, frontier, summit, el capitan, aurora, amd gpu, gpu, nvidia"/> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="cookie.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"], jax: ["input/TeX","output/HTML-CSS"], }); // This file is set as MATHJAX_CODEFILE in the Doxyfile. It configures how // MathJax renders expressions in Markdown so that it is consistent with GitHub. MathJax.Hub.Config({ extensions: ["tex2jax.js"], jax: ["input/TeX", "output/HTML-CSS"], tex2jax: { inlineMath: [ ['$', '$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true, ignoreClass: "line" // Ignore code blocks: https://web.archive.org/web/20120430100225/http://www.mathjax.org/docs/1.1/options/tex2jax.html }, "HTML-CSS": { fonts: ["TeX"] } }); </script> <script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link rel="shortcut icon" href="icon.ico" type="image/x-icon" /> <link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/> <link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/> <link href="custom.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="icon.ico"/></td> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">MFC </div> <div id="projectbrief">Exascale flow solver</div> </td> </tr> </tbody> </table> </div> <!-- Cross-navigation injected into sidebar via script below --> <script> document.addEventListener('DOMContentLoaded', function() { var nav = document.createElement('div'); nav.id = 'mfc-nav'; var items = [ ['../documentation/index.html', 'documentation', 'User Guide'], ['../api/index.html', 'api', 'API Documentation'] ]; var path = window.location.pathname; var apiPaths = ['/api/', '/pre_process/', '/simulation/', '/post_process/']; for (var i = 0; i < items.length; i++) { var a = document.createElement('a'); a.href = items[i][0]; a.textContent = items[i][2]; if (items[i][1] === 'api') { for (var j = 0; j < apiPaths.length; j++) { if (path.indexOf(apiPaths[j]) !== -1) { a.className = 'active'; break; } } } else { if (path.indexOf('/' + items[i][1] + '/') !== -1) a.className = 'active'; } nav.appendChild(a); } var sideNav = document.getElementById('side-nav'); if (sideNav) sideNav.insertBefore(nav, sideNav.firstChild); }); </script> <!-- end header part --> <!-- Generated by Doxygen 1.16.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search/",'.html'); </script> <script type="text/javascript"> $(function() { codefold.init(); }); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search',true); $(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(function(){initNavTree('docker.html','',''); }); </script> <div id="container"> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <div id="MSearchResults"> <div class="SRPage"> <div id="SRIndex"> <div id="SRResults"></div> <div class="SRStatus" id="Loading">Loading...</div> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> </div> </div> </div> </div> <div><div class="header"> <div class="headertitle"><div class="title">Containers </div></div> </div><!--header--> <div class="contents"> <div class="textblock"><h1 class="doxsection"><a class="anchor" id="autotoc_md129"></a> Containers</h1> <h2 class="doxsection"><a class="anchor" id="autotoc_md130"></a> Navigating Docker</h2> <p>Install Docker on</p><ul> <li><a href="https://docs.docker.com/desktop/setup/install/mac-install/">MacOS</a></li> <li><a href="https://docs.docker.com/desktop/setup/install/windows-install/">Windows</a></li> <li><a href="https://docs.docker.com/desktop/setup/install/linux/">Linux</a></li> </ul> <h3 class="doxsection"><a class="anchor" id="autotoc_md131"></a> Docker Desktop GUI</h3> <ul> <li>Search for the <a href="https://hub.docker.com/r/sbryngelson/mfc">sbryngelson/mfc</a> repository. All the MFC containers are stored here.</li> <li>Find and pull a release tag (e.g., <span class="tt">latest-cpu</span>).<ul> <li>Read through the <b>Tag Details</b> below to distinguish between them. Docker Desktop's left sidebar has two key tabs: <b>Images</b> stores your program copies, and <b>Containers</b> shows instances of those images. You can launch multiple containers from a single image.</li> </ul> </li> <li>Start a container by navigating to the <span class="tt">Images</span> tab and clicking the <span class="tt">Run</span> button.<ul> <li>Use the <em>Exec</em> section to interact with MFC directly via terminal, the <em>Files</em> section to transfer files between your device and container, and the <em>Stats</em> section to display resource usage.</li> </ul> </li> </ul> <h3 class="doxsection"><a class="anchor" id="autotoc_md132"></a> Docker CLI</h3> <p>You can navigate Docker entirely from the command line. From a bash-like shell, pull from the <a href="https://hub.docker.com/r/sbryngelson/mfc">sbryngelson/mfc</a> repository and run the latest MFC container: </p><div class="fragment"><div class="line">docker run -it --rm --entrypoint bash sbryngelson/mfc:latest-cpu</div> </div><!-- fragment --><p><b>Selecting OS/ARCH:</b> Docker selects the compatible architecture by default when pulling and running a container. You can manually specify your platform if something seems to go wrong, as Docker may suggest doing so. For example, <span class="tt">linux/amd64</span> handles many *nix-based x86 architectures, and <span class="tt">linux/arm64</span> handles Apple Silicon and Arm-based *nix devices. You can specify it like this: </p><div class="fragment"><div class="line">docker run -it --rm --entrypoint bash --platform linux/amd64 sbryngelson/mfc:latest-cpu</div> </div><!-- fragment --><p><b>What's Next?</b></p> <p>Once a container has started, the primary working directory is <span class="tt">/opt/MFC</span>, and all necessary files are located there. You can check out the usual MFC documentation, such as the <a class="el" href="examples.html" title="Example Cases">Example Cases</a>, to get familiar with running cases. Then, review the <a class="el" href="case.html" title="Case Files">Case Files</a> to write a custom case file.</p> <h2 class="doxsection"><a class="anchor" id="autotoc_md133"></a> Details on Running Containers</h2> <p>Let's take a closer look at running MFC within a container. Kick off a CPU container: </p><div class="fragment"><div class="line">docker run -it --rm --entrypoint bash sbryngelson/mfc:latest-cpu</div> </div><!-- fragment --><p> Or, start a GPU container. </p><div class="fragment"><div class="line">docker run -it --rm --gpus all --entrypoint bash sbryngelson/mfc:latest-gpu</div> </div><!-- fragment --><p><b>Note:</b> <span class="tt">--gpus all</span> exposes the container to available GPUs, and <em>only NVIDIA GPUs are currently supported</em>. <a href="https://stackoverflow.com/questions/9727688/how-to-get-the-cuda-version">Ensure your device's CUDA version is at least 12.3</a> to avoid backward compatibility issues.</p> <p><b>Mounting Directory</b></p> <p>Mount a directory to <span class="tt">mnt</span> inside the container to easily transfer files between your host computer and the separate container. For example, <span class="tt">cp -r <source> /mnt/destination></span> moves something from your source computer to the container (reverse the order for the reverse to happen!). </p><div class="fragment"><div class="line">docker run -it --rm --entrypoint bash -v "$PWD":/mnt sbryngelson/mfc:latest-cpu</div> </div><!-- fragment --><p><b>Shared Memory</b></p> <p>If you run a job with multiple MPI ranks, you could run into <em>MPI memory binding errors</em>. This can manifest as a failed test (launched via <span class="tt">./mfc.sh test</span>) and running cases with <span class="tt">./mfc.sh run -n X <path/to/case.py></span> where <span class="tt">X > 1</span>. To avoid this issue, you can increase the shared memory size (to keep MPI working): </p><div class="fragment"><div class="line">docker run -it --rm --entrypoint bash --shm-size=<e.g., 4gb> sbryngelson/mfc:latest-cpu</div> </div><!-- fragment --><p> or avoid MPI altogether via <span class="tt">./mfc.sh <your commands> --no-mpi</span>.</p> <h3 class="doxsection"><a class="anchor" id="autotoc_md134"></a> Portability</h3> <p>On the source machine, pull and save the image: </p><div class="fragment"><div class="line">docker pull sbryngelson/mfc:latest-cpu</div> <div class="line">docker save -o mfc:latest-cpu.tar sbryngelson/mfc:latest-cpu</div> </div><!-- fragment --><p> On the target machine, load and run the image: </p><div class="fragment"><div class="line">docker load -i mfc:latest-cpu.tar</div> <div class="line">docker run -it --rm mfc:latest-cpu</div> </div><!-- fragment --><h2 class="doxsection"><a class="anchor" id="autotoc_md135"></a> Using Supercomputers/Clusters via Apptainer/Singularity</h2> <h3 class="doxsection"><a class="anchor" id="autotoc_md136"></a> Interactive Shell</h3> <div class="fragment"><div class="line">apptainer shell --nv --fakeroot --writable-tmpfs --bind "$PWD":/mnt docker://sbryngelson/mfc:latest-gpu</div> <div class="line">Apptainer>cd /opt/MFC</div> </div><!-- fragment --><p> or </p><div class="fragment"><div class="line">apptainer exec --nv --fakeroot --writable-tmpfs --bind "$PWD":/mnt docker://sbryngelson/mfc:latest-gpu bash -c "cd /opt/MFC && bash"</div> </div><!-- fragment --><p> To run MFC on CPUs, omit <span class="tt">--nv</span> and use the <span class="tt">mfc:latest-cpu</span> container image.</p> <h3 class="doxsection"><a class="anchor" id="autotoc_md137"></a> For Portability</h3> <p>On the source machine, pull and translate the image into <span class="tt">.sif</span> format: </p><div class="fragment"><div class="line">apptainer build mfc:latest-gpu.sif docker://sbryngelson/mfc:latest-gpu</div> </div><!-- fragment --><p> On the target machine, load and start an interactive shell: </p><div class="fragment"><div class="line">apptainer shell --nv --fakeroot --writable-tmpfs --bind "$PWD":/mnt mfc:latest-gpu.sif</div> </div><!-- fragment --><h3 class="doxsection"><a class="anchor" id="autotoc_md138"></a> Slurm Job</h3> <p>Below is an example Slurm batch job script. Refer to your machine's user guide for instructions on properly loading and using Apptainer. </p><div class="fragment"><div class="line">#!/bin/bash</div> <div class="line">#SBATCH --job-name=mfc-sim</div> <div class="line">#SBATCH --nodes=2</div> <div class="line">#SBATCH --ntasks-per-node=12</div> <div class="line">#SBATCH --time=06:00:00</div> <div class="line">#SBATCH --partition=</div> <div class="line">#SBATCH --output=mfc-sim-%j.out</div> <div class="line">#SBATCH --error=mfc-sim-%j.err</div> <div class="line"> </div> <div class="line">cd $SLURM_SUBMIT_DIR</div> <div class="line"> </div> <div class="line"># Define container image</div> <div class="line">CONTAINER="mfc:latest-gpu.sif"</div> <div class="line"> </div> <div class="line">apptainer exec --nv --fakeroot --writable-tmpfs \</div> <div class="line">--bind "$PWD":/mnt \</div> <div class="line"> $CONTAINER \</div> <div class="line"> bash -c "cd /opt/MFC && ./mfc.sh run sim/case.py -- -c <computer>"</div> </div><!-- fragment --><p>In the above,</p><ul> <li>The <span class="tt">/sim</span> directory should have all the simulation files, including the case setup (<span class="tt">case.py</span>).</li> <li>The <span class="tt">--nv --fakeroot --writable-tmpfs</span> set of flags are needed to<ul> <li>Grant access to the host system's NVIDIA GPUs and its CUDA libraries.</li> <li>Enable root-like permissions inside the container without actual root access.</li> <li>Allow temporary write access to the container filesystem.</li> </ul> </li> </ul> <h2 class="doxsection"><a class="anchor" id="autotoc_md139"></a> Tag Details</h2> <h3 class="doxsection"><a class="anchor" id="autotoc_md140"></a> Base Images</h3> <ul> <li>CPU images (v4.3.0-latest releases) are built on <b>Ubuntu 22.04</b>.</li> <li>GPU images (v4.3.0-latest releases) are built on <b>NVHPC SDK 23.11 (CUDA 12.3) & Ubuntu 22.04</b>.</li> </ul> <h3 class="doxsection"><a class="anchor" id="autotoc_md141"></a> Tag Structure</h3> <ul> <li><b><span class="tt">vx.x.x</span></b> - Official MFC release versions (recommended: use <span class="tt">latest</span> release)</li> <li><b><span class="tt">cpu/gpu</span></b> - Build configurations for CPU or GPU acceleration.</li> <li><b><span class="tt">ubuntu-xx.xx</span></b> - Base Ubuntu version (standard = <span class="tt">amd64</span>, <span class="tt">-arm</span> = <span class="tt">arm64</span>)</li> </ul> <h3 class="doxsection"><a class="anchor" id="autotoc_md142"></a> Example Tags</h3> <div class="fragment"><div class="line">mfc:latest-xxx # Latest version (amd64 & arm64)</div> <div class="line">mfc:vx.x.x-cpu # CPU version (amd64 & arm64)</div> <div class="line">mfc:vx.x.x-gpu # GPU version (amd64 & arm64)</div> <div class="line">mfc:vx.x.x-xxx-ubuntu-xx.xx # amd64 natively-supported version</div> <div class="line">mfc:vx.x.x-xxx-ubuntu-xx.xx-arm # arm64 natively-supported version</div> </div><!-- fragment --><h3 class="doxsection"><a class="anchor" id="autotoc_md143"></a> Architecture Support</h3> <p>You can specify your architecture with <span class="tt">--platform <os>/<arch></span>, typically either <span class="tt">linux/amd64</span> or <span class="tt">linux/arm64</span>. If you are unsure, Docker automatically selects the compatible image with your system architecture. If native support isn't available, QEMU emulation is enabled for the following architectures, albeit with degraded performance. </p><div class="fragment"><div class="line">linux/amd64</div> <div class="line">linux/amd64/v2</div> <div class="line">linux/amd64/v3</div> <div class="line">linux/arm64</div> <div class="line">linux/riscv64</div> <div class="line">linux/ppc64le</div> <div class="line">linux/s390x</div> <div class="line">linux/386</div> <div class="line">linux/mips64le</div> <div class="line">linux/mips64</div> <div class="line">linux/loong64</div> <div class="line">linux/arm/v7</div> <div class="line">linux/arm/v6</div> </div><!-- fragment --><div style="text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;">Page last updated: 2026-10-10</div> </div></div><!-- contents --> </div><!-- PageDoc --> </div><!-- doc-content --> <div id="page-nav" class="page-nav-panel"> <div id="page-nav-resize-handle"></div> <div id="page-nav-tree"> <div id="page-nav-contents"> </div><!-- page-nav-contents --> </div><!-- page-nav-tree --> </div><!-- page-nav --> </div><!-- container --> <!-- HTML footer for doxygen 1.9.1--> <!-- start footer part --> <div id="nav-path" class="navpath"> <ul></ul> </div> </body> </html> |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |