Skip to content

Commit

Permalink
deploy: d38ecc0
Browse files Browse the repository at this point in the history
  • Loading branch information
JunjieYU-UoM committed Jan 15, 2025
1 parent 93d41f3 commit 933cd00
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 36 deletions.
15 changes: 5 additions & 10 deletions _sources/notebooks/hpc/singularity.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@ pyclmuapp on HPC: Python
================
Docker are not always available on HPC. Singularity is a container software usually employed in **HPC** (High performance computer). It provides a mechanism to run containers where containers can be used to package entire scientific workflows, software and libraries, and even data. Ref: https://ri.itservices.manchester.ac.uk/csf3/software/applications/singularity/

A quick look for python scripts of pyclmuapp ``singularity`` mode
A quick look for python scripts of pyclmuapp ``singularity`` mode.

Note! We recommend to use the ``singularity`` mode on HPC, and install `pyclmuapp` from source code (There is some configuration changed, which is not upadted to Pypi).

.. code-block:: python
from pyclmuapp import usp_clmu
# initialize
o = usp_clmu(
pwd=None,
input_path="your_inputdata_path",
output_path="your_ctsm_arhchive",
log_path="your_ctsm_caseoutputs",
scripts_path="your_ctsm_case_scripts_path",
container_type='singularity') # important to define the container_type. The default is docker
o = usp_clmu(container_type='singularity') # important to define the container_type. The default is docker
# the clmu-app_1.0.sif image will be download from docker hub at the current work dir.
o.docker(cmd="pull",
cmdlogfile="None",) # This will pull the image from the docker hub
o.docker(cmd="pull", cmdlogfile="None",) # This will pull the image from the docker hub
# other parameters are available, see the Python API documentation
# no need to o.docker(cmd="run") for singularity
# then same as usually
Expand Down
12 changes: 6 additions & 6 deletions _sources/notebooks/overview/installation.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ $ conda activate pyclmuapp
$ conda install -c conda-forge numpy pandas xarray haversine netcdf4 nc-time-axis
```

Step 3: install using `pip`
Step 3: install from source

---

```bash
$ pip install pyclmuapp
$ git clone https://github.com/envdes/pyclmuapp
$ cd pyclmuapp
$ python setup.py install
```

(optional) install from source
Step 3: install using `pip`

---

```bash
$ git clone https://github.com/envdes/pyclmuapp
$ cd pyclmuapp
$ python setup.py install
$ pip install pyclmuapp
```
2 changes: 1 addition & 1 deletion _sources/notebooks/usp/warmup.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"\n",
"- urban_hac (str) – The flag to turn on the urban HAC. The default is “ON_WASTEHEAT”. valid_values=”OFF”,”ON”,”ON_WASTEHEAT”.\n",
"\n",
"- run_tyep (str) – The type of the run. The default is “run”. use “usp-execp” to run the sup mode."
"- run_tyep (str) – The type of the run. The default is “usp”. or use “usp-execp” to run when container is started."
]
},
{
Expand Down
14 changes: 4 additions & 10 deletions notebooks/hpc/singularity.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,15 @@
<section id="pyclmuapp-on-hpc-python">
<h1>pyclmuapp on HPC: Python<a class="headerlink" href="#pyclmuapp-on-hpc-python" title="Link to this heading"></a></h1>
<p>Docker are not always available on HPC. Singularity is a container software usually employed in <strong>HPC</strong> (High performance computer). It provides a mechanism to run containers where containers can be used to package entire scientific workflows, software and libraries, and even data. Ref: <a class="reference external" href="https://ri.itservices.manchester.ac.uk/csf3/software/applications/singularity/">https://ri.itservices.manchester.ac.uk/csf3/software/applications/singularity/</a></p>
<p>A quick look for python scripts of pyclmuapp <code class="docutils literal notranslate"><span class="pre">singularity</span></code> mode</p>
<p>A quick look for python scripts of pyclmuapp <code class="docutils literal notranslate"><span class="pre">singularity</span></code> mode.</p>
<p>Note! We recommend to use the <code class="docutils literal notranslate"><span class="pre">singularity</span></code> mode on HPC, and install <cite>pyclmuapp</cite> from source code (There is some configuration changed, which is not upadted to Pypi).</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">pyclmuapp</span><span class="w"> </span><span class="kn">import</span> <span class="n">usp_clmu</span>

<span class="c1"># initialize</span>
<span class="n">o</span> <span class="o">=</span> <span class="n">usp_clmu</span><span class="p">(</span>
<span class="n">pwd</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">input_path</span><span class="o">=</span><span class="s2">&quot;your_inputdata_path&quot;</span><span class="p">,</span>
<span class="n">output_path</span><span class="o">=</span><span class="s2">&quot;your_ctsm_arhchive&quot;</span><span class="p">,</span>
<span class="n">log_path</span><span class="o">=</span><span class="s2">&quot;your_ctsm_caseoutputs&quot;</span><span class="p">,</span>
<span class="n">scripts_path</span><span class="o">=</span><span class="s2">&quot;your_ctsm_case_scripts_path&quot;</span><span class="p">,</span>
<span class="n">container_type</span><span class="o">=</span><span class="s1">&#39;singularity&#39;</span><span class="p">)</span> <span class="c1"># important to define the container_type. The default is docker</span>
<span class="n">o</span> <span class="o">=</span> <span class="n">usp_clmu</span><span class="p">(</span><span class="n">container_type</span><span class="o">=</span><span class="s1">&#39;singularity&#39;</span><span class="p">)</span> <span class="c1"># important to define the container_type. The default is docker</span>

<span class="c1"># the clmu-app_1.0.sif image will be download from docker hub at the current work dir.</span>
<span class="n">o</span><span class="o">.</span><span class="n">docker</span><span class="p">(</span><span class="n">cmd</span><span class="o">=</span><span class="s2">&quot;pull&quot;</span><span class="p">,</span>
<span class="n">cmdlogfile</span><span class="o">=</span><span class="s2">&quot;None&quot;</span><span class="p">,)</span> <span class="c1"># This will pull the image from the docker hub</span>
<span class="n">o</span><span class="o">.</span><span class="n">docker</span><span class="p">(</span><span class="n">cmd</span><span class="o">=</span><span class="s2">&quot;pull&quot;</span><span class="p">,</span> <span class="n">cmdlogfile</span><span class="o">=</span><span class="s2">&quot;None&quot;</span><span class="p">,)</span> <span class="c1"># This will pull the image from the docker hub</span>
<span class="c1"># other parameters are available, see the Python API documentation</span>
<span class="c1"># no need to o.docker(cmd=&quot;run&quot;) for singularity</span>
<span class="c1"># then same as usually</span>
Expand Down
12 changes: 6 additions & 6 deletions notebooks/overview/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,18 @@ <h1>Installation<a class="headerlink" href="#installation" title="Link to this h
$<span class="w"> </span>conda<span class="w"> </span>install<span class="w"> </span>-c<span class="w"> </span>conda-forge<span class="w"> </span>numpy<span class="w"> </span>pandas<span class="w"> </span>xarray<span class="w"> </span>haversine<span class="w"> </span>netcdf4<span class="w"> </span>nc-time-axis
</pre></div>
</div>
<p>Step 3: install using <code class="docutils literal notranslate"><span class="pre">pip</span></code></p>
<hr class="docutils" />
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pyclmuapp
</pre></div>
</div>
<p>(optional) install from source</p>
<p>Step 3: install from source</p>
<hr class="docutils" />
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/envdes/pyclmuapp
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>pyclmuapp
$<span class="w"> </span>python<span class="w"> </span>setup.py<span class="w"> </span>install
</pre></div>
</div>
<p>Step 3: install using <code class="docutils literal notranslate"><span class="pre">pip</span></code></p>
<hr class="docutils" />
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pyclmuapp
</pre></div>
</div>
</section>


Expand Down
2 changes: 1 addition & 1 deletion notebooks/usp/warmup.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ <h3>2 Run a simulation<a class="headerlink" href="#2-Run-a-simulation" title="Li
<li><p>iflog (bool) – The flag to log the output. The default is True.</p></li>
<li><p>logfile (str) – The log file name. The default is pwd+”log.log”.</p></li>
<li><p>urban_hac (str) – The flag to turn on the urban HAC. The default is “ON_WASTEHEAT”. valid_values=”OFF”,”ON”,”ON_WASTEHEAT”.</p></li>
<li><p>run_tyep (str) – The type of the run. The default is “run”. use “usp-execp” to run the sup mode.</p></li>
<li><p>run_tyep (str) – The type of the run. The default is “usp”. or use “usp-execp” to run when container is started.</p></li>
</ul>
</section>
<section id="3-How-to-get-your-own-input-files?">
Expand Down
2 changes: 1 addition & 1 deletion notebooks/usp/warmup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"\n",
"- urban_hac (str) – The flag to turn on the urban HAC. The default is “ON_WASTEHEAT”. valid_values=”OFF”,”ON”,”ON_WASTEHEAT”.\n",
"\n",
"- run_tyep (str) – The type of the run. The default is “run”. use “usp-execp” to run the sup mode."
"- run_tyep (str) – The type of the run. The default is “usp”. or use “usp-execp” to run when container is started."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 933cd00

Please sign in to comment.