<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://arcleeds.github.io/assets/xslt/rss.xslt" ?>
<?xml-stylesheet type="text/css" href="https://arcleeds.github.io/assets/css/rss.css" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Research Computing at Leeds</title>
		<description>Welcome to the official website for the Research Computing service from the University of Leeds.</description>
		<link>https://arcleeds.github.io/</link>
		<atom:link href="https://arcleeds.github.io/feed.xml" rel="self" type="application/rss+xml" />
		
			<item>
				<title>Recording and exporting conda environments for Python</title>
				<link>https://arcleeds.github.io/blog/condaEnvs/</link>
				<pubDate>Thu, 29 Aug 2024 00:00:00 +0000</pubDate>
				<description>&lt;h1 id=&quot;recording-and-exporting-conda-environments-for-python&quot;&gt;Recording and exporting conda environments for Python&lt;/h1&gt;

&lt;p&gt;When it comes to version and package management for Python, there are an overwhelming number of options, including minimal approaches including &lt;a href=&quot;https://github.com/pyenv/pyenv&quot;&gt;pyenv&lt;/a&gt;, &lt;a href=&quot;https://pypi.org/project/pipenv/&quot;&gt;pipenv&lt;/a&gt;, and &lt;a href=&quot;https://docs.python.org/3/library/venv.html&quot;&gt;venv&lt;/a&gt;; conda-centric approaches including &lt;a href=&quot;https://www.anaconda.com/&quot;&gt;Anaconda&lt;/a&gt;, &lt;a href=&quot;https://docs.anaconda.com/miniconda/&quot;&gt;Miniconda&lt;/a&gt;, and &lt;a href=&quot;https://github.com/conda-forge/miniforge&quot;&gt;Miniforge&lt;/a&gt;, and multi-featured package and project-management tools such as &lt;a href=&quot;https://pixi.sh/latest/&quot;&gt;Pixi&lt;/a&gt; and &lt;a href=&quot;https://python-poetry.org/&quot;&gt;Poetry&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Depending on your specific use-case, some of these tools may be better suited to your project; for example, if you are developing a package and want to build your binaries locally, Poetry might be a great solution for you. If you want to install scientific packages from certain conda channels, one of the conda ecosystem options might suit you best.&lt;/p&gt;

&lt;p&gt;Let’s assume you are working within a research group that generally uses conda envs, and you are installing software that frequently includes conda-related install instructions. We recommend using &lt;a href=&quot;https://github.com/conda-forge/miniforge&quot;&gt;Miniforge&lt;/a&gt;, the open source Mamba-enabled tool that is essentially drop-and-replace with conda.&lt;/p&gt;

&lt;p&gt;How do you organise your conda environments while you are developing your code, and when you want to share it? How should you share your environment files?&lt;/p&gt;

&lt;h2 id=&quot;creating-conda-environments&quot;&gt;Creating conda environments&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;Remember, don’t work from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;base&lt;/code&gt;! Always install libraries and run code within a dedicated separate environment. This way, if you break an environment or end up in a complete tangle of dependencies, you can just create a new environment, whereas if you are working in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;base&lt;/code&gt; you may have to uninstall and reinstall conda in order to fix your environment!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When building an environment with multiple different Python (or R!) packages or modules, dependencies and requirements may mean you need to use a slightly-older-than-latest version of some other packages. This, in turn, may restrict what versions of other packages you need. Say you want to install the imaginary package &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;science&lt;/code&gt;. The package &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;science&lt;/code&gt; depends on Python version 3.x specifically and newer versions will break it because of how a specific feature works in the background. Now, you want to install the equally imaginary package &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;research&lt;/code&gt;, but the most recent version depends on a feature implemented in the most recent version of Python - and so &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;research&lt;/code&gt; will break if we try to install the newest version. Because we are restricted to Python 3.x, we need to pick a slightly older version of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;research&lt;/code&gt; that will work with the other packages in our environment.&lt;/p&gt;

&lt;p&gt;You can see immediately why we would want different isolated environments for different coding projects, but you can also see that even in a single project, juggling different dependencies can become tricky.&lt;/p&gt;

&lt;p&gt;If you create a conda environment using&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;conda create &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; myenv python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and then after activating it, add packages using&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;conda &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;imaginary-science-package
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;you can end up in a bit of a pickle, as package dependencies will be set depending on the order in which they have been installed, potentially leading to conflicts when you try to install later packages and you discover that the environment already contains incompatible versions of different libraries.&lt;/p&gt;

&lt;p&gt;Instead, it’s usually a good idea if at all possible to list all your required packages (including any pinned versions, such as requiring Python 3.x in the example above) in an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;environment.yml&lt;/code&gt; file. This allows conda to figure out exactly what versions of different libraries are required to ensure all your packages actually work together (if at all possible).&lt;/p&gt;

&lt;p&gt;The environment file should look something like this:&lt;/p&gt;

&lt;div class=&quot;language-yml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;packaging-env&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;python=3.12&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pytest&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;setuptools&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;sphinx&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;blackd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This example contains a bunch of conda packages that are useful for writing your own Python packages. You can use this to create a conda environment using the command (replacing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;environment.yml&lt;/code&gt; with the file name or path of your environment file):&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;conda &lt;span class=&quot;nb&quot;&gt;env &lt;/span&gt;create &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; environment.yml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Of course, if needed, you can always add more packages to this later by running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda install package-name&lt;/code&gt; from inside the active environment.&lt;/p&gt;

&lt;h3 id=&quot;adding-pip-packages-to-your-conda-env&quot;&gt;Adding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pip&lt;/code&gt; packages to your conda env&lt;/h3&gt;

&lt;p&gt;Adding packages with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pip&lt;/code&gt; introduces messiness and complexity when it comes to dependency management and organisation, but sometimes it cannot be avoided.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Remember, once you have installed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pip&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pip&lt;/code&gt;-dependent packages in your environment, you can’t return to using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda install&lt;/code&gt; without everything likely breaking.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you know from the get-go that you need &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pip&lt;/code&gt; installed in your environment, you can include it in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;environment.yml&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&quot;language-yml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mkdocs-env&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;channels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;defaults&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;python=3.12&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pip&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;pip&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mkdocs&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;mkdocstrings[python]&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mkdocs-material&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This file contains packages required to build a documentation website using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mkdocs&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;using-your-environment&quot;&gt;Using your environment&lt;/h2&gt;

&lt;p&gt;If you have a selection of similar environments that have subtly differing package versions, make sure you record exactly which environment you are using for your research calculations.&lt;/p&gt;

&lt;p&gt;Ideally, all your results should be produced with the same environment, as trying to keep track of when you added or updated a package in an environment can become very messy, very quickly.&lt;/p&gt;

&lt;h2 id=&quot;recording-your-environment&quot;&gt;Recording your environment&lt;/h2&gt;

&lt;p&gt;Recording your environment is really important, both for ensuring that your research computing work is transparent (with exact versions of packages used to produce results recorded) and reproducible (by making it possible for people to recreate your working environment). Of course, if you create your environment from an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;environment.yml&lt;/code&gt; file then you have a ready-made recipe for people to build an equivalent environment, but if you want to record the exact versions of packages used (which you should want to do!) or if you added additional packages later, you can export your environment.&lt;/p&gt;

&lt;p&gt;There are quite a few different ways to export your conda environment. The most straightforward is to simply call &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export&lt;/code&gt; from within your active environment:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;conda &lt;span class=&quot;nb&quot;&gt;env export&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; environment.yml &lt;span class=&quot;c&quot;&gt;# from inside the env&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will create a record with every package and its version in your environment, including background dependencies that you did not specify but were required by your packages. This file will include specific builds of packages and a path to the environment directory on your machine.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This is a really useful record of the exact environment you used to create your results; however, it is not broadly usable to create a new environment from due to specified builds&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can remove the specified builds:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;conda &lt;span class=&quot;nb&quot;&gt;env export&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--no-builds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; environment.yml &lt;span class=&quot;c&quot;&gt;# from inside the env&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hypothetically, this resulting file &lt;em&gt;can&lt;/em&gt; be used to create a conda environment (using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda env create -f environment.yml&lt;/code&gt;); however, the extensive pinning of every single library means it is likely to break on any system except the one it was created on (and will fail there too if anything has been updated).&lt;/p&gt;

&lt;p&gt;You can fix this issue completely by passing the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;from-history&lt;/code&gt; flag, which instead lists only what you specified (so, it will include specific versions if you requested them when making the environment, such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python=3.12&lt;/code&gt;):&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;conda &lt;span class=&quot;nb&quot;&gt;env export&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--from-history&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; environment.yml &lt;span class=&quot;c&quot;&gt;# from inside the env&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is great for quickly building an environment file that people can use to create a similar environment to yours, but it does lose a lot of useful information about what package versions you used in your research. &lt;strong&gt;Additionally, this will not capture any &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pip&lt;/code&gt; requirements&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you have installed packages with pip from inside your conda env, you will need to add a few steps to record these requirements. &lt;a href=&quot;https://github.com/conda/conda/issues/9628#issuecomment-1608913117&quot;&gt;ekiwi111&lt;/a&gt; on GitHub provides the following useful code snippet:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Extract installed pip packages&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;pip_packages&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;conda &lt;span class=&quot;nb&quot;&gt;env export&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-A9999&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;.*- pip:&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;^prefix: &quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Export conda environment without builds, and append pip packages&lt;/span&gt;
conda &lt;span class=&quot;nb&quot;&gt;env export&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--from-history&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;^prefix: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; new-environment.yml
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$pip_packages&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; new-environment.yml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For more flexibility in pip package versions, we can modify this to cut the pip version numbers out:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Extract installed pip packages&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;pip_packages&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;conda &lt;span class=&quot;nb&quot;&gt;env export&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-A9999&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;.*- pip:&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;^prefix: &quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Export conda environment without builds, and append pip packages&lt;/span&gt;
conda &lt;span class=&quot;nb&quot;&gt;env export&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--from-history&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;^prefix: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; new-environment.yml
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$pip_packages&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; new-environment.yml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;a-possible-workflow&quot;&gt;A possible workflow&lt;/h2&gt;

&lt;p&gt;It’s often a good idea to both create a robust record of your work using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda env export &amp;gt; environment.yml&lt;/code&gt; (or some sensible environment file name) and then a more user-friendly one that makes use of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--from-history&lt;/code&gt; flag or the code snippets above (again, called something distinct and sensible).&lt;/p&gt;

&lt;p&gt;This means you have a detailed record of the exact environment that was used to create your code, and so if down the line someone fails to reproduce your results, they can look at the versions of libraries you used to see if they can track down the discrepancies.&lt;/p&gt;

&lt;p&gt;At the same time, you have an easy-to-use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yml&lt;/code&gt; file that you can point to in your documentation and include along some example Python scripts to help other researchers get up and running and using your code quickly.&lt;/p&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;p&gt;There are many, many different tools to manage and record dependencies and packages in Python; conda is just one (very popular) option of many. There are also many different schools of thought on how you should record dependencies; the above is just a workflow that has worked for me in the past, that I think balances practical reuseability (by peers who would like to use your code) and theoretical reproducibility (where the exact conditions of your research can theoretically be recreated).&lt;/p&gt;

&lt;p&gt;In a future post, I hope to delve into balancing a development environment (which you use while writing your Python code, for linting and packaging it) and a production/research environment (that you use when conducting research), and how the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pyproject.toml&lt;/code&gt; file format can help. If you’d like a sneak preview, you can look at some of my course notes &lt;a href=&quot;https://software-dev.streamlit.app/Project_Workflow#3-create-a-dev-env&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What tools do you use to manage packages? What solutions have you found to sharing your research environment? Does your research group have a preferred approach or does each researcher use their own preferred tools?&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/condaEnvs/</guid>
			</item>
		
			<item>
				<title>A Journey into Parallel Python - Episode 1</title>
				<link>https://arcleeds.github.io/blog/parallelSeriesEpisode1/</link>
				<pubDate>Thu, 19 Oct 2023 00:00:00 +0000</pubDate>
				<description>&lt;h2 id=&quot;episode-1-introduction-to-multiprocessing&quot;&gt;Episode 1: Introduction to Multiprocessing&lt;/h2&gt;

&lt;p&gt;Python is a versatile and powerful programming language known for its simplicity and ease of use. However, as programs grow in complexity, there is a pressing need for efficient execution, especially when dealing with computationally intensive tasks. This is where parallel computing comes into play. In this blog series, we will explore various aspects of parallel Python, starting with multiprocessing.&lt;/p&gt;

&lt;h3 id=&quot;when-to-use-parallelism&quot;&gt;When to Use Parallelism&lt;/h3&gt;

&lt;p&gt;Parallel computing is particularly advantageous when dealing with tasks that can be split into smaller independent sub-tasks. These sub-tasks can be executed concurrently on multiple processors, reducing the overall execution time.&lt;/p&gt;

&lt;h3 id=&quot;introducing-multiprocessing-module&quot;&gt;Introducing Multiprocessing Module&lt;/h3&gt;

&lt;p&gt;Python’s multiprocessing module provides a powerful way to harness the full potential of multi-core processors by creating multiple processes, each with its own Python interpreter. This enables true parallel execution and makes it an easy choice for tasks that benefit from parallelism.&lt;/p&gt;

&lt;h3 id=&quot;the-experiment-parallel-prime-number-search&quot;&gt;The Experiment: Parallel Prime Number Search&lt;/h3&gt;

&lt;p&gt;In this experiment, we will tackle a classic problem: finding prime numbers. A straightforward, sequential approach to finding prime numbers can be slow and inefficient when dealing with a large range of numbers. Our goal is to compare the performance of a sequential approach with parallel solutions using multiprocessing.&lt;/p&gt;

&lt;h4 id=&quot;serial-solution&quot;&gt;Serial Solution&lt;/h4&gt;

&lt;p&gt;In our journey to explore the benefits of parallel computing in Python, we begin with a foundational experiment: finding prime numbers using a sequential approach. This experiment sets the baseline for performance against which we will compare the results of our parallel solutions.&lt;/p&gt;

&lt;p&gt;We start by iterating through the range of numbers one by one. For each number, we apply a primality test using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;is_prime&lt;/code&gt; function. This function checks whether a number is prime or not, and, after that, checks another number. While this method is straightforward and easy to understand, it can become sluggish when dealing with a large range of numbers.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/parallelSeries/episode1/serial.png&quot; alt=&quot;Serial Schema&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;plain-multiprocessing&quot;&gt;Plain Multiprocessing&lt;/h4&gt;

&lt;p&gt;Plain multiprocessing involves distributing every number to a process, each running the prime-checking function concurrently. The results are then collected and combined to identify prime numbers.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/parallelSeries/episode1/plain.png&quot; alt=&quot;Plain Multiprocessing Schema&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;multiprocessing-with-chunks&quot;&gt;Multiprocessing with Chunks&lt;/h4&gt;

&lt;p&gt;In this alternative approach, we divide the range of numbers into smaller chunks and assign each chunk to a separate process. The chunk results are then collected and combined to identify prime numbers.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/parallelSeries/episode1/chunk.png&quot; alt=&quot;Plain Multiprocessing Schema&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;serial-vs-parallel-a-performance-comparison&quot;&gt;Serial vs. Parallel: A Performance Comparison&lt;/h3&gt;

&lt;p&gt;In our journey to explore the world of parallel Python, we conducted a series of experiments to compare the performance of different parallel solutions in the context of prime number generation. The experiments were conducted on three different ranges of numbers: 10^6, 10^7, and 10^8. We measured the execution time in seconds for each approach and configuration. The expereiments were done on ARC4 using an entire node with 40 cores and 192GB of memory.&lt;/p&gt;

&lt;h4 id=&quot;serial-approach&quot;&gt;Serial Approach&lt;/h4&gt;

&lt;p&gt;We initiated our exploration by implementing a sequential prime number search, which served as the baseline for our performance comparison. The results were as follows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For 10^6 numbers, the sequential approach took approximately 2.88 seconds.&lt;/li&gt;
  &lt;li&gt;For 10^7 numbers, the execution time increased to more than a minute (71.11 seconds).&lt;/li&gt;
  &lt;li&gt;With a larger range of 10^8 numbers, the execution time significantly escalated to approximately 32.36 minutes (1941.63 seconds).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These execution times demonstrated the inefficiency of a sequential approach when dealing with larger datasets. It also provided us with a baseline to measure improvements achieved by parallelism.&lt;/p&gt;

&lt;p&gt;The non-linear scaling of execution time can be primarily attributed to the nature of the prime search algorithm. This algorithm involves a for loop that iterates with the size of the input number. As the input size increases, the number of iterations required by the algorithm grows proportionally. Consequently, the execution time exhibits a non-linear increase, making the algorithm less efficient for larger input sizes.&lt;/p&gt;

&lt;p&gt;While hardware constraints play a role in overall execution time, the algorithm’s inherent complexity and its dependence on input size are the dominant factors in this context. Understanding the algorithm’s behaviour is the first step in identifying areas for improvement.&lt;/p&gt;

&lt;p&gt;In the subsequent sections, we will explore how parallelism can address these challenges and significantly improve the performance of prime number generation in Python.&lt;/p&gt;

&lt;h4 id=&quot;parallel-plain-approach&quot;&gt;Parallel Plain Approach&lt;/h4&gt;

&lt;p&gt;We then explored a plain parallel approach, distributing the prime number search across multiple processes. The results showed promising improvements:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For 10^6 numbers, the parallel plain approach took approximately 2.41 seconds, making it approximately 1.19 times faster than the serial version.&lt;/li&gt;
  &lt;li&gt;With 10^7 numbers, the execution time reduced to approximately 18.56 seconds, achieving a speedup of about 3.82 times.&lt;/li&gt;
  &lt;li&gt;For 10^8 numbers, we observed a substantial reduction in execution time, with approximately 4 minutes (238.96 seconds), making it approximately 8.14 times faster than the serial approach.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although we have attempted to divide the workload into 40 cores theoretically, the improvement in simulation time is not significant. This may be due to the nature of the problem as checking whether a number is prime or not is not a time-consuming task. The lower performance improvement can be attributed to the substantial overhead introduced by parallelism, particularly the creation and management of multiple processes and communication between them. Often, the speed at which processes complete their tasks can surpass the efficiency of communication between cores. This leads to underutilization of available CPU cores. The image below depicts this finding: we never managed to have 40 cores using 100% of CPU for Python tasks.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/parallelSeries/episode1/cpu_plain.png&quot; alt=&quot;Plain Parallel CPU Usage&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;parallel-chunk-approach&quot;&gt;Parallel Chunk Approach&lt;/h4&gt;

&lt;p&gt;Next, we implemented a parallel chunk approach, where we divided the range of numbers into chunks and assigned each chunk to a separate process. This is an attempt to create larger process to avoid the communication overhead. The task here is find the right ballance between the time we lose managing all processes and keeping all cores using 100% of CPU as much as possible. This approach allowed us to fine-tune the level of parallelism. The results for 40 chunks were particularly impressive:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For 10^6 numbers, the parallel chunk approach took approximately 0.27 seconds, showcasing a substantial improvement, approximately 10.67 times faster than the serial version.&lt;/li&gt;
  &lt;li&gt;With 10^7 numbers, execution time reduced to approximately 4.09 seconds, achieving a remarkable speedup of about 17.38 times.&lt;/li&gt;
  &lt;li&gt;Even with the most extensive range of 10^8 numbers, the execution time was significantly reduced to approximately 1.62 minutes (97.32 seconds), making it approximately 19.98 times faster than the serial approach.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By using chunks, every process spend more time running and less time communicating. This improves the overall efficiency of the experiment. As you can see bellow, with this approach we manage to hit all 40 cores:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/parallelSeries/episode1/cpu_chunk.png&quot; alt=&quot;Chunk Parallel CPU Usage&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;chunk-size-optimization&quot;&gt;Chunk size optimization&lt;/h4&gt;

&lt;p&gt;The last thing to be analysed is the amount of chunks we use (sometimes called amount of workers). See the plot related with the larger problem:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/parallelSeries/episode1/chunk_ballance.png&quot; alt=&quot;Chunk size&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Optimizing the number of chunks in the parallel chunk approach is essential. You can notice in this example that employing 40 chunks may not yield the best performance. This observation is rooted in the fact that &lt;em&gt;prime checking&lt;/em&gt; a small number is considerably quicker than &lt;em&gt;prime checking&lt;/em&gt; a larger number, so check 0-1000 is quicker than check 1001-2000. As a result, some cores complete their tasks rapidly, while others are still operating at full capacity. Striking a balance is the key - having enough chunks ensures that when the quicker intervals finish, a new process can efficiently begin on the same core. However, it’s crucial not to have an excessive number of chunks, as this can lead to excessive overhead in communication, which could potentially offset the time gained through core optimization.&lt;/p&gt;

&lt;h3 id=&quot;discussion&quot;&gt;Discussion&lt;/h3&gt;

&lt;p&gt;The experiments clearly highlighted the advantages of parallelism in Python, particularly when dealing with computationally intensive tasks. The plain parallel approach, which distributed the workload one a one among processes, provided a noticeable speedup compared to the sequential approach.&lt;/p&gt;

&lt;p&gt;The parallel chunk approach, where we fine-tuned the level of parallelism by dividing the workload into chunks, demonstrated the most significant performance gains. It showcased the potential for leveraging the full power of multi-core processors in Python.&lt;/p&gt;

&lt;p&gt;These results underscore the critical role of configuring parallelization for unlocking its full potential. It’s important to recognize that every problem exhibits unique characteristics, and the optimal configuration may differ from what we’ve uncovered in the context of prime number searching. The primary aim of this blog post is to enhance your understanding of parallelization principles, equipping you with the knowledge and insights to adapt these concepts to your specific problem domains. By grasping how parallelization operates, we hope you’re better prepared to navigate the intricacies of parallel computing and apply this valuable expertise to your own diverse range of challenges.&lt;/p&gt;

&lt;p&gt;In the subsequent posts of this series, we will delve deeper into parallel Python, exploring various parallel frameworks, advanced techniques, and best practices to further optimize your Python code for parallelism.&lt;/p&gt;

&lt;p&gt;Please forward this blog to a friend!&lt;/p&gt;

&lt;h3 id=&quot;appendix&quot;&gt;Appendix&lt;/h3&gt;

&lt;h4 id=&quot;results-table&quot;&gt;Results Table&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Type&lt;/th&gt;
      &lt;th&gt;Number of chunks&lt;/th&gt;
      &lt;th&gt;Time (s) for 10^6 numbers&lt;/th&gt;
      &lt;th&gt;Time (s) for 10^7 numbers&lt;/th&gt;
      &lt;th&gt;Time (s) for 10^8 numbers&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Serial&lt;/td&gt;
      &lt;td&gt;-&lt;/td&gt;
      &lt;td&gt;2.8817241191864014&lt;/td&gt;
      &lt;td&gt;71.11308193206787&lt;/td&gt;
      &lt;td&gt;1941.6339194774628&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel plain&lt;/td&gt;
      &lt;td&gt;-&lt;/td&gt;
      &lt;td&gt;2.4120452404022217&lt;/td&gt;
      &lt;td&gt;18.561339616775513&lt;/td&gt;
      &lt;td&gt;238.9633448123932&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;40&lt;/td&gt;
      &lt;td&gt;0.2703585624694824&lt;/td&gt;
      &lt;td&gt;4.094743490219116&lt;/td&gt;
      &lt;td&gt;97.31855487823486&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;80&lt;/td&gt;
      &lt;td&gt;0.24828743934631348&lt;/td&gt;
      &lt;td&gt;3.825242280960083&lt;/td&gt;
      &lt;td&gt;90.49211573600769&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;120&lt;/td&gt;
      &lt;td&gt;0.252028226852417&lt;/td&gt;
      &lt;td&gt;3.7143449783325195&lt;/td&gt;
      &lt;td&gt;87.85042238235474&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;160&lt;/td&gt;
      &lt;td&gt;0.2476975917816162&lt;/td&gt;
      &lt;td&gt;3.532663106918335&lt;/td&gt;
      &lt;td&gt;84.7046332359314&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;200&lt;/td&gt;
      &lt;td&gt;0.25487828254699707&lt;/td&gt;
      &lt;td&gt;3.8439860343933105&lt;/td&gt;
      &lt;td&gt;92.25035429000854&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;240&lt;/td&gt;
      &lt;td&gt;0.2679781913757324&lt;/td&gt;
      &lt;td&gt;3.7825417518615723&lt;/td&gt;
      &lt;td&gt;87.7009825706482&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;280&lt;/td&gt;
      &lt;td&gt;0.24977588653564453&lt;/td&gt;
      &lt;td&gt;3.7289867401123047&lt;/td&gt;
      &lt;td&gt;89.66810250282288&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;320&lt;/td&gt;
      &lt;td&gt;0.24884271621704102&lt;/td&gt;
      &lt;td&gt;3.53690242767334&lt;/td&gt;
      &lt;td&gt;83.89400172233582&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;360&lt;/td&gt;
      &lt;td&gt;0.25550150871276855&lt;/td&gt;
      &lt;td&gt;3.665968656539917&lt;/td&gt;
      &lt;td&gt;88.5750949382782&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;400&lt;/td&gt;
      &lt;td&gt;0.24846792221069336&lt;/td&gt;
      &lt;td&gt;3.839165449142456&lt;/td&gt;
      &lt;td&gt;88.95045518875122&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;400&lt;/td&gt;
      &lt;td&gt;0.25121283531188965&lt;/td&gt;
      &lt;td&gt;3.779390573501587&lt;/td&gt;
      &lt;td&gt;89.48629188537598&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;800&lt;/td&gt;
      &lt;td&gt;0.2497234344482422&lt;/td&gt;
      &lt;td&gt;3.5345916748046875&lt;/td&gt;
      &lt;td&gt;84.97951412200928&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;1200&lt;/td&gt;
      &lt;td&gt;0.2505936622619629&lt;/td&gt;
      &lt;td&gt;3.643186092376709&lt;/td&gt;
      &lt;td&gt;88.95472049713135&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;1600&lt;/td&gt;
      &lt;td&gt;0.25502467155456543&lt;/td&gt;
      &lt;td&gt;3.566555976867676&lt;/td&gt;
      &lt;td&gt;85.43585753440857&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;2000&lt;/td&gt;
      &lt;td&gt;0.25293874740600586&lt;/td&gt;
      &lt;td&gt;3.6725733280181885&lt;/td&gt;
      &lt;td&gt;86.09180688858032&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;2400&lt;/td&gt;
      &lt;td&gt;0.2573375701904297&lt;/td&gt;
      &lt;td&gt;3.570603847503662&lt;/td&gt;
      &lt;td&gt;86.07818627357483&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;2800&lt;/td&gt;
      &lt;td&gt;0.25385212898254395&lt;/td&gt;
      &lt;td&gt;3.64874529838562&lt;/td&gt;
      &lt;td&gt;84.89961862564087&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;3200&lt;/td&gt;
      &lt;td&gt;0.2503926753997803&lt;/td&gt;
      &lt;td&gt;3.6192290782928467&lt;/td&gt;
      &lt;td&gt;86.25797414779663&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;3600&lt;/td&gt;
      &lt;td&gt;0.25528526306152344&lt;/td&gt;
      &lt;td&gt;3.632573127746582&lt;/td&gt;
      &lt;td&gt;85.19222736358643&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;4000&lt;/td&gt;
      &lt;td&gt;0.264545202255249&lt;/td&gt;
      &lt;td&gt;3.541602849960327&lt;/td&gt;
      &lt;td&gt;85.67413830757141&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;4400&lt;/td&gt;
      &lt;td&gt;0.2594177722930908&lt;/td&gt;
      &lt;td&gt;3.6193411350250244&lt;/td&gt;
      &lt;td&gt;86.78273630142212&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;4800&lt;/td&gt;
      &lt;td&gt;0.25583815574645996&lt;/td&gt;
      &lt;td&gt;3.59921932220459&lt;/td&gt;
      &lt;td&gt;85.94321131706238&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;5200&lt;/td&gt;
      &lt;td&gt;0.255126953125&lt;/td&gt;
      &lt;td&gt;3.626305103302002&lt;/td&gt;
      &lt;td&gt;85.91821503639221&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;5600&lt;/td&gt;
      &lt;td&gt;0.2588353157043457&lt;/td&gt;
      &lt;td&gt;3.6022090911865234&lt;/td&gt;
      &lt;td&gt;86.6257905960083&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;6000&lt;/td&gt;
      &lt;td&gt;0.2574269771575928&lt;/td&gt;
      &lt;td&gt;3.5766496658325195&lt;/td&gt;
      &lt;td&gt;83.9020631313324&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;6400&lt;/td&gt;
      &lt;td&gt;0.268543004989624&lt;/td&gt;
      &lt;td&gt;3.629772901535034&lt;/td&gt;
      &lt;td&gt;86.50152969360352&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;6800&lt;/td&gt;
      &lt;td&gt;0.2680470943450928&lt;/td&gt;
      &lt;td&gt;3.6349997520446777&lt;/td&gt;
      &lt;td&gt;85.8815438747406&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;7200&lt;/td&gt;
      &lt;td&gt;0.26164889335632324&lt;/td&gt;
      &lt;td&gt;3.6494381427764893&lt;/td&gt;
      &lt;td&gt;86.1327075958252&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel chunk&lt;/td&gt;
      &lt;td&gt;7600&lt;/td&gt;
      &lt;td&gt;0.2591238021850586&lt;/td&gt;
      &lt;td&gt;3.566507577896118&lt;/td&gt;
      &lt;td&gt;83.9977662563324&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h4 id=&quot;requirements&quot;&gt;Requirements&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;python = 3.11.5&lt;/li&gt;
  &lt;li&gt;numpy = 1.26.0&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;imports&quot;&gt;Imports&lt;/h4&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;numpy&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;time&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;multiprocessing&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Pool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cpu_count&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;itertools&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chain&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;primes-code&quot;&gt;Primes code&lt;/h4&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;is_prime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    Check if a number is prime.

    Args:
        n (int): The number to check for primality.

    Returns:
        bool: True if the number is prime, False otherwise.
    &quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;find_primes_in_range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    Find prime numbers in a range of numbers.

    Args:
        numbers (numpy.ndarray): An array of numbers to check for primality.

    Returns:
        list: A list of array of Boolean values indicating whether each number is prime.
    &quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;is_prime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;primes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;experiments-code&quot;&gt;Experiments Code&lt;/h4&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;serial_test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    Perform a serial test to find prime numbers in a range of numbers.

    Args:
        numbers (numpy.ndarray): An array of numbers to check for primality.

    Returns:
        numpy.ndarray: An array of prime numbers.
        float: The time taken for the operation.
    &quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;t0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;serial_primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;find_primes_in_range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;serial_primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;serial_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;serial_time&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serial_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serial_time&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;parallel_plain_test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    Perform a parallel plain test to find prime numbers in a range of numbers using multiprocessing.

    Args:
        numbers (numpy.ndarray): An array of numbers to check for primality.
        num_processes (int): The number of processes to use for parallelization.

    Returns:
        numpy.ndarray: An array of prime numbers.
        float: The time taken for the operation.
    &quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;t0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Pool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;processes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;parallel_primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;is_prime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;parallel_primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parallel_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;parallel_time&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parallel_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parallel_time&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;parallel_chunk_test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers_chunk&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    Perform a parallel chunk test to find prime numbers in a range of numbers using multiprocessing.

    Args:
        numbers_chunk (list): A list of chunks, each containing numbers to check for primality.
        num_processes (int): The number of processes to use for parallelization.

    Returns:
        numpy.ndarray: An array of prime numbers.
        float: The time taken for the operation.
    &quot;&quot;&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;t0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Pool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;processes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;chunk_primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;find_primes_in_range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;numbers_chunk&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;flat_primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;chain&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;from_iterable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;chunk_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# 1D list
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;chunk_primes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flat_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;chunk_time&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk_time&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;__name__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;__main__&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cpu_count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;total_numbers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1_000_000&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# up to 1_000_000_00
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total_numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Serial version
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;serial_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serial_time&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serial_test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Serial version found &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;serial_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; primes in &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;serial_time&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; seconds.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Plain Multiprocessing - All cores
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;plain_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;plain_time&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parallel_plain_test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Parallel plain version found &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plain_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; primes in &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;plain_time&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; seconds.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Multiprocessing with chunks
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;chunk_scale&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk_scale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;numbers_chunk&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;array_split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;chunk_primes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk_time&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parallel_chunk_test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers_chunk&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Parallel chunk version using &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num_processes&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; processes in &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;chunk_time&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; seconds.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;hpc-job-submission&quot;&gt;HPC Job Submission&lt;/h4&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#Run with current environment (-V) and in the current directory (-cwd)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#$ -V -cwd&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#Request some time- min 15 mins - max 48 hours&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#$ -l h_rt=05:00:00&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Ask for a full node (40 cores and 192G)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#$ -l nodes=1&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#Get email at start and end of the job&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#$ -m be&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#Now run the job&lt;/span&gt;
python primes.py

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/parallelSeriesEpisode1/</guid>
			</item>
		
			<item>
				<title>Autumn 2023 Training Courses now open</title>
				<link>https://arcleeds.github.io/blog/Autumn2023TrainingCourses/</link>
				<pubDate>Fri, 22 Sep 2023 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;We’ve now confirmed some upcoming training courses which are now open for registrations!&lt;/p&gt;

&lt;p&gt;Whether you want to learn some Git, Linux command line or learn more about the University’s high performance computing systems we’ve got a course for you.
They are hands-on so be prepared to do some typing!&lt;/p&gt;

&lt;p&gt;All booking is managed through SAP and by the IT Training team, any questions about your booking should be directed to &lt;a href=&quot;mailto:ittraining@leeds.ac.uk&quot;&gt;ittraining@leeds.ac.uk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Find booking links on the course web pages below.&lt;/p&gt;

&lt;h2 id=&quot;october-2023&quot;&gt;October 2023&lt;/h2&gt;

&lt;h3 id=&quot;hpc0-introduction-to-linux&quot;&gt;HPC0: Introduction to Linux&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 3rd October 9:30am-12:30pm (Online)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a hands-on workshop intended as an introduction to the Linux command line and shell scripting. The purpose of the workshop is to give users the Linux skills to be able to handle data and files, run programs and automate workflows on a PC and on the HPC service. The content of this workshop is equally suited for people who wish to use command line Linux on a PC, in the Cloud or on a HPC platform. New and prospective HPC users are advised to take this workshop before taking the HPC1: Introduction to High Performance Computing at Leeds workshop.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc0/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;hpc1-hpc-carpentry&quot;&gt;HPC1: HPC Carpentry&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 10th October 9:30am-12:30pm and Tuesday 17th October 9:30am-12:30pm (Online)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workshop is designed to introduce new users to the High Performance Computing (HPC) service at Leeds. It will be useful if you are new to HPC in research or have used HPC elsewhere. It is suitable for researchers from all faculties and examples will be given from a range of research domains. The purpose of the workshop is to give users the skills to be an effective user of the HPC service and to get codes and applications running effectively. The online version of this course is split over two sessions a week apart, please do not apply for this course unless you are able to attend ALL the sessions.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc1/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd1a-introduction-to-python-programming&quot;&gt;SWD1a: Introduction to Python programming&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Thursday 5th October 10am-4pm and Friday 6th October 10am-4pm (Online)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is an introduction to programming in Python for people with little or no previous programming experience. The course is suitable for attendees from all research domains and we will use a Web based programming environment (a Jupyter Notebook) which means you will be able to apply the ideas you learn on the course straightaway without having to install any software at home or at work. This course is running as 2 all day sessions. Please do not apply for this course unless you are able to attend ALL the sessions.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd1a/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd1b-introduction-to-r-programming&quot;&gt;SWD1b: Introduction to R Programming&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Monday 16th October 10am-4pm and Monday 23th October 10am-4pm (Online)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is an introduction to programming in R for people with little or no previous programming experience. It uses plotting and visualising data as its motivating example based on an established research dataset. The course is suitable for attendees from all research domains and we will use a Web based programming environment (RStudio cloud) which means you will be able to apply the ideas you learn on the course straightaway without having to install any software at home or at work. This course is running as 2 all day sessions. Please do not apply for this course unless you are able to attend ALL the sessions.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd1b/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd6-high-performance-python&quot;&gt;SWD6: High Performance Python&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Friday 13rd October 10:00am-4:00pm (In-Person)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Over the past few years, Python and the wider Python ecosystem have become invaluable tools in scientific computing and data analytics. As Python is (for the most part) an interpreted language there are complaints that Python code can be quite slow to execute. In this hands-on workshop you will have the opportunity discover and use a set of tools and techniques that can be used to improve the execution speed of your Python code. The workshop will introduce a number of ways to both measure the efficiency of your code and improve its speed of execution by introducing strategies for fast and scalable computation with Python.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd6/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h2 id=&quot;november-2023&quot;&gt;November 2023&lt;/h2&gt;

&lt;h3 id=&quot;hpc0-introduction-to-linux-1&quot;&gt;HPC0: Introduction to Linux&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Thursday 23rd November 9:30am-12:30pm (In-Person)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a hands-on workshop intended as an introduction to the Linux command line and shell scripting. The purpose of the workshop is to give users the Linux skills to be able to handle data and files, run programs and automate workflows on a PC and on the HPC service. The content of this workshop is equally suited for people who wish to use command line Linux on a PC, in the Cloud or on a HPC platform. New and prospective HPC users are advised to take this workshop before taking the HPC1: Introduction to High Performance Computing at Leeds workshop.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc0/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;hpc1-hpc-carpentry-1&quot;&gt;HPC1: HPC Carpentry&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Thursday 30th November 10am-4pm (In-Person)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workshop is designed to introduce new users to the High Performance Computing (HPC) service at Leeds. It will be useful if you are new to HPC in research or have used HPC elsewhere. It is suitable for researchers from all faculties and examples will be given from a range of research domains. The purpose of the workshop is to give users the skills to be an effective user of the HPC service and to get codes and applications running effectively. The online version of this course is split over two sessions a week apart, please do not apply for this course unless you are able to attend ALL the sessions.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc1/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;hpc2-applications-and-containers-on-hpc&quot;&gt;HPC2: Applications and containers on HPC&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Wednesday 8th November 9:30am-12:30pm and Wednesday 15th November 9:30am-12:30pm (Online)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workshop is designed to introduce the application development environment available on the HPC service and give hands on practice managing, installing and compiling codes on the HPC service. This workshop will be most useful for researchers who need to manage and install their own applications and research codes. This workshop builds on the skills developed on the HPC 1: Introduction to High Performance Computing at Leeds workshop. This course is split over two sessions a week apart, please do not apply for this course unless you are able to attend ALL the sessions.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc2/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd1a-introduction-to-python-programming-1&quot;&gt;SWD1a: Introduction to Python programming&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Monday 13th November 10am-4pm and Wednesday 15th November 10am-4pm (In-Person)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is an introduction to programming in Python for people with little or no previous programming experience. The course is suitable for attendees from all research domains and we will use a Web based programming environment (a Jupyter Notebook) which means you will be able to apply the ideas you learn on the course straightaway without having to install any software at home or at work. This course is running as 2 all day sessions. Please do not apply for this course unless you are able to attend ALL the sessions.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd1a/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd2-version-control-with-git-and-github&quot;&gt;SWD2: Version Control with Git and GitHub&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Friday 10th November 10am-4pm (In-Person)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Version control can be thought of as the lab notebook of the digital world: it’s what professional software developers and authors use to keep track of what they’ve done and to collaborate with other people. Every large software development project relies on it, and most programmers use it for their small jobs as well. It isn’t just for software: books, papers, small data sets, and anything that changes over time or needs to be shared can and should be stored in a version control system.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd2/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd3-software-development-practices-for-research&quot;&gt;SWD3: Software development practices for Research&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 21st November 10am-4pm (In-Person)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The purpose of this workshop is to introduce a number of the techniques and concepts that professional software developers use to manage their code, projects and teams. Although the development of research codes and software has different needs and challenges to the development of commercial software, there are nonetheless some tools and techniques that we can adopt or adopt to improve our Research Software Engineering. This isn’t a programming workshop, so it will be relevant to you whichever programming language (on Windows, Linux or Mac) or infrastructure (HPC, Cloud, Desktop) you use. This will be a hands-on session with lots of discussion and small group activities. We’ll be joined by a number of people who develop codes and software who will share their experiences.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd3/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h2 id=&quot;december-2023&quot;&gt;December 2023&lt;/h2&gt;

&lt;h3 id=&quot;swd1a-introduction-to-python-programming-2&quot;&gt;SWD1a: Introduction to Python programming&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Wednesday 6th December 10am-4pm and Wednesday 13rd December 10am-4pm (Online)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is an introduction to programming in Python for people with little or no previous programming experience. The course is suitable for attendees from all research domains and we will use a Web based programming environment (a Jupyter Notebook) which means you will be able to apply the ideas you learn on the course straightaway without having to install any software at home or at work. This course is running as 2 all day sessions. Please do not apply for this course unless you are able to attend ALL the sessions.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd1a/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;There are limited spaces for these courses so if you are unable to book on you can still join the priority waiting list so you are contacted when we next run the training course.&lt;/p&gt;

&lt;p&gt;Please forward this blog to a friend!&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/Autumn2023TrainingCourses/</guid>
			</item>
		
			<item>
				<title>Summer 2023 Training Courses now open</title>
				<link>https://arcleeds.github.io/blog/Summer2023TrainingCourses/</link>
				<pubDate>Thu, 01 Jun 2023 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;New upcoming training courses which are now open for registrations!&lt;/p&gt;

&lt;p&gt;Whether you want to learn some Linux command line or learn more about the University’s high performance computing systems we’ve got a course for you.&lt;/p&gt;

&lt;p&gt;All booking is managed through SAP and by the IT Training team, any questions about your booking should be directed to ittraining@leeds.ac.uk.&lt;/p&gt;

&lt;p&gt;Find booking links on the course web pages below.&lt;/p&gt;

&lt;h2 id=&quot;june-2023&quot;&gt;June 2023&lt;/h2&gt;

&lt;h3 id=&quot;hpc0-introduction-to-linux-online&quot;&gt;HPC0: Introduction to Linux (Online)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Thursday 22nd June 9:30am-12:30pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a hands-on workshop intended as an introduction to the Linux command line and shell scripting. It is suitable for Linux, Unix and Mac OSX users. The purpose of the workshop is to give users the Linux skills to be able to handle data and files, run programs and automate workflows on a PC and on the HPC service. The content of this workshop is equally suited for people who wish to use command line Linux on a PC, in the Cloud or on a HPC platform. New and prospective HPC users are advised to take this workshop before taking the HPC1: Introduction to High Performance Computing at Leeds workshop.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://arc.leeds.ac.uk/training/courses/hpc0/&quot;&gt;https://arc.leeds.ac.uk/training/courses/hpc0/&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;hpc1-hpc-carpentry-online&quot;&gt;HPC1: HPC Carpentry (Online)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Thursday 29th June 9:30am-12:30pm&lt;/li&gt;
  &lt;li&gt;Thursday 6th July 9:30am-12:30pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workshop is designed to introduce new users to the High Performance Computing (HPC) service at Leeds. It will be useful if you are new to HPC in research or have used HPC elsewhere. It is suitable for researchers from all faculties and examples will be given from a range of research domains. The purpose of the workshop is to give users the skills to be an effective user of the HPC service and to get codes and applications running effectively. This course is split over two sessions a week apart, &lt;strong&gt;please do not apply for this course unless you are able to attend ALL the sessions&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://arc.leeds.ac.uk/training/courses/hpc1/&quot;&gt;https://arc.leeds.ac.uk/training/courses/hpc1/&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;swd6-high-performance-python-online&quot;&gt;SWD6: High Performance Python (Online)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 27th June 10:00am-4:00pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Over the past few years, Python and the wider Python ecosystem have become invaluable tools in scientific computing and data analytics. As Python is (for the most part) an interpreted language there are complaints that Python code can be quite slow to execute. In this hands-on workshop you will have the opportunity discover and use a set of tools and techniques that can be used to improve the execution speed of your Python code. The workshop will introduce a number of ways to both measure the efficiency of your code and improve its speed of execution by introducing strategies for fast and scalable computation with Python.&lt;/p&gt;

&lt;p&gt;At the end of this workshop, learners will be able to:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Understand how to profile Python code and identify bottlenecks&lt;/li&gt;
  &lt;li&gt;Understand how to choose the most appropriate data structure, algorithm, and libraries for a problem&lt;/li&gt;
  &lt;li&gt;Improve the execution time of Python code using:
    &lt;ul&gt;
      &lt;li&gt;Vectorisation (with &lt;a href=&quot;https://numpy.org/doc/stable/reference/ufuncs.html&quot;&gt;NumPy&lt;/a&gt;)&lt;/li&gt;
      &lt;li&gt;Compilers (with &lt;a href=&quot;https://numba.pydata.org/&quot;&gt;Numba&lt;/a&gt;)&lt;/li&gt;
      &lt;li&gt;Parallelisation (with &lt;a href=&quot;https://docs.dask.org/en/latest/&quot;&gt;Dask&lt;/a&gt; and &lt;a href=&quot;https://www.ray.io/&quot;&gt;Ray&lt;/a&gt;)&lt;/li&gt;
      &lt;li&gt;GPUs (with &lt;a href=&quot;https://jax.readthedocs.io/en/latest/index.html&quot;&gt;JAX&lt;/a&gt;, &lt;a href=&quot;https://developer.nvidia.com/how-to-cuda-python&quot;&gt;CUDA/Numba&lt;/a&gt;, and &lt;a href=&quot;https://developer.nvidia.com/rapids&quot;&gt;RAPIDS&lt;/a&gt;)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Understand when to use each technique&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;N.B. This course has recently been updated and course contents may change at the time of delivery.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://arc.leeds.ac.uk/training/courses/swd6/&quot;&gt;https://arc.leeds.ac.uk/training/courses/swd6/&lt;/a&gt;&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/Summer2023TrainingCourses/</guid>
			</item>
		
			<item>
				<title>Building an R package for the Nutrient Profile Model</title>
				<link>https://arcleeds.github.io/blog/nutrientprofiler-r-pkg/</link>
				<pubDate>Tue, 25 Apr 2023 00:00:00 +0000</pubDate>
				<description>&lt;h2 id=&quot;building-a-package-in-r&quot;&gt;Building a package in R&lt;/h2&gt;

&lt;p&gt;Over the last few months I’ve been involved in a research software engineering
project working with Vicki Jenneson at the CDRC. This project looked at
extending the functionality of their &lt;a href=&quot;https://npmcalculator.cdrc.ac.uk/&quot;&gt;Nutrient Profile Model calculator Shiny
app&lt;/a&gt;. As part of this I looked at developing
a separate R package that implemented a series of functions to represent the
Nutrient Profile Model logic and could be applied to product data in bulk.&lt;/p&gt;

&lt;p&gt;I’ve used the R language for several years, although predominantly as a scripting
language in data science (using the &lt;a href=&quot;https://www.tidyverse.org/&quot;&gt;tidyverse&lt;/a&gt;), or
developing web apps (using &lt;a href=&quot;https://shiny.rstudio.com/&quot;&gt;Shiny&lt;/a&gt;). I haven’t ever
written an R package before so this project has been a really interesting
experience looking at the R packaging ecosystem.&lt;/p&gt;

&lt;p&gt;My main reference point for this experience is the fantastic &lt;a href=&quot;https://r-pkgs.org/&quot;&gt;R packaging
book&lt;/a&gt; developed by Hadley Wickham and Jennifer Bryan that
is available free online and provides a really handy guide for how to go about
developing an R package. This naturally led me to the &lt;a href=&quot;https://devtools.r-lib.org/&quot;&gt;devtools
package&lt;/a&gt;, which is an R package designed to help
you build an R package.&lt;/p&gt;

&lt;p&gt;A further tangent on my setup is that I also looked at using a
&lt;a href=&quot;https://code.visualstudio.com/docs/devcontainers/containers&quot;&gt;devcontainers&lt;/a&gt; for
developing this package, which is a personal design choice and not at all
necessary but helped ensure a seamless developer experience between different
devices!&lt;/p&gt;

&lt;p&gt;To get started with writing an R package using
&lt;a href=&quot;https://devtools.r-lib.org/&quot;&gt;devtools&lt;/a&gt; is straight forward. Devtools also
brings with it the package &lt;a href=&quot;https://usethis.r-lib.org/&quot;&gt;usethis&lt;/a&gt; which includes
a number of functions for automatically setting up parts of our package. This
includes setting up our initial package folder. We get started with
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;usethis::create_package()&lt;/code&gt; which creates our package folder locally with all
the standard boilerplate we need to get started. &lt;a href=&quot;https://usethis.r-lib.org/&quot;&gt;Usethis&lt;/a&gt;
is also very useful for integrating additional tools like
&lt;a href=&quot;https://testthat.r-lib.org/&quot;&gt;testthat&lt;/a&gt; for testing and 
&lt;a href=&quot;https://roxygen2.r-lib.org/&quot;&gt;roxygen2&lt;/a&gt; for documentation, all through functions
that handle initial boilerplate. Adopting &lt;a href=&quot;https://devtools.r-lib.org/&quot;&gt;devtools&lt;/a&gt;, it
is worth noting however, will dictate your workflow. The way we’ll write and
interact with our developing package will be through a series of devtools
functions such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devtools::test()&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devtools::check()&lt;/code&gt;. I didn’t find any
problems with this approach but I can imagine there might be certain flexibility
drawbacks if you want to have a super custom setup.&lt;/p&gt;

&lt;p&gt;When starting this project I came to it from my previous experience in
Python and object orientated programming concepts. Whilst these exist within R
it isn’t a truly object oriented language and has a number of &lt;a href=&quot;https://adv-r.hadley.nz/oo.html&quot;&gt;different systems
for implementing object oriented features&lt;/a&gt;.
With the time available I briefly dabbled with these but eventually dropped them
in favour of adopting a purely functional approach and in particular trying to
write something that could behave reasonably nicely with
&lt;a href=&quot;https://www.tidyverse.org/&quot;&gt;tidyverse&lt;/a&gt; packages (although not explicitly depend
upon them).&lt;/p&gt;

&lt;p&gt;So the basic workflow of developing this package was creating a file within R
that contained the functions I wanted for a specific functionality of the
package. Writing tests for those functions and saving them in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tests/testthat&lt;/code&gt;.
Using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devtools::test()&lt;/code&gt; to check the tests pass. Writing roxygen2 doc strings on
my functions and writing Rmarkdown vignettes showing how to use the package in
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vignettes&lt;/code&gt;. Putting this all together using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devtools::check&lt;/code&gt; to make sure the
package built and passed checks for both tests, documentation and vignettes and
pushing these to GitHub. I also used pkgdown to build a GitHub pages based
documentation website which allowed me to present the internal documentation and
vignettes publicly for users. &lt;a href=&quot;https://usethis.r-lib.org/&quot;&gt;Usethis&lt;/a&gt; and
&lt;a href=&quot;https://pkgdown.r-lib.org/&quot;&gt;pkgdown&lt;/a&gt; also come with out of the box GitHub
actions setup which is very nice and convenient for setting up CI based
documentation deployment.&lt;/p&gt;

&lt;p&gt;This all makes for a pretty nice workflow for developing a package. It feels
familiar to the Python world where you also typically use a variety of 3rd party
packages to help manage your package development (although unlike in Python we
aren’t overwhelmed by choice for package build tools). It is however quite a bit of
extra complexity, although I recognise tools like devtools are actually trying
to reduce this complexity(!), and that is a lot to take on for beginners. This
again makes me grateful for the excellent book I’ve used to guide me through
this process and would recommend it in a heartbeat for anyone else interested in
developing an R package.&lt;/p&gt;

&lt;h2 id=&quot;introducing-nutrientprofiler&quot;&gt;Introducing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nutrientprofiler&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;This leads me to introduce the package developed during this project called
&lt;a href=&quot;https://github.com/Leeds-CDRC/nutrientprofiler/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nutrientprofiler&lt;/code&gt;&lt;/a&gt;. This
package implements a series of functions that aim to help users assess product
nutritional information against the &lt;a href=&quot;https://www.gov.uk/government/publications/the-nutrient-profiling-model&quot;&gt;UK Government Nutrient Profile
Model&lt;/a&gt;.
This model was developed by the UK Department of Health to help Ofcom
implement restrictions in advertising of foods that are high in fats, salt and
sugar (HFSS) and now forms the basis of &lt;a href=&quot;https://www.gov.uk/government/publications/restricting-promotions-of-products-high-in-fat-sugar-or-salt-by-location-and-by-volume-price/restricting-promotions-of-products-high-in-fat-sugar-or-salt-by-location-and-by-volume-price-implementation-guidance&quot;&gt;new legislation&lt;/a&gt; restricting in-store and online placement-based promotions.&lt;/p&gt;

&lt;p&gt;The CDRC had previously developed a single form Shiny App that implements this
model for helping check a product against the Nutrient Profile Model. This
package expands on that logic and provides it as explicit low level R functions,
along side high level R functions for applying the Nutrient Profile Model across
datasets of products. The final part of the RSE project has been integrating the
&lt;a href=&quot;https://github.com/Leeds-CDRC/nutrientprofiler/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nutrientprofiler&lt;/code&gt;&lt;/a&gt; package
into the Shiny app to support NPM modelling for multiple products at once.&lt;/p&gt;

&lt;p&gt;At present the package is not available via CRAN but can be downloaded directly
from GitHub using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;remotes&lt;/code&gt; package:&lt;/p&gt;

&lt;div class=&quot;language-R highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;install.packages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;remotes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;remotes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;install_github&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Leeds-CDRC/nutrientprofiler&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Vicki Jenneson, who has helped lead on this project said the following about RSE
involvement:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Having support from Alex in the RSE team has been invaluable for this project. Alex was able to unpick a complex challenge and translate it into a simple set of logical steps, providing a well-organised, flexible and transparent data flow within the R package. Alex approached the project with professionalism and took the time to walk me through his work in a way that I could understand, even introducing me to some of the basics of R package building and using Github. I’m excited to have a scalable version of the NPM calculator, thanks to all the work which Alex put in.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/nutrientprofiler-r-pkg/</guid>
			</item>
		
			<item>
				<title>Using Conda or Spack to install geospatial R packages on ARC4</title>
				<link>https://arcleeds.github.io/blog/conda-r-geospatial/</link>
				<pubDate>Wed, 19 Apr 2023 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;Occasionally, we get requests in about issues installing geospatial R packages
on our HPC systems. These are big geospatial packages like
&lt;a href=&quot;https://cran.r-project.org/web/packages/sf/index.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sf&lt;/code&gt;&lt;/a&gt; or
&lt;a href=&quot;https://cran.r-project.org/web/packages/terra/index.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terra&lt;/code&gt;&lt;/a&gt; that are
fantastic libraries that have dependencies on big geospatial system libraries.&lt;/p&gt;

&lt;p&gt;One way to solve this is to use the &lt;a href=&quot;https://docs.conda.io/en/latest/&quot;&gt;Conda package
manager&lt;/a&gt; to install these geospatial libraries
as well as using it to install R itself. One advantage in using Conda to manage
your R installations is that it any R packages installed will also be installed
within that specific R environment helping us separate out R packages into
distinct projects controlled by the Conda environment.&lt;/p&gt;

&lt;p&gt;Let’s imagine we want to install
&lt;a href=&quot;https://cran.r-project.org/web/packages/terra/index.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terra&lt;/code&gt;&lt;/a&gt;, a spatial
data analysis package that is the successor to the
&lt;a href=&quot;https://cran.r-project.org/web/packages/raster/index.html&quot;&gt;raster&lt;/a&gt; package and
&lt;a href=&quot;https://cran.r-project.org/web/packages/sf/index.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sf&lt;/code&gt;&lt;/a&gt;, the simple
features package for encoding spatial vector data. These are big spatial
packages that require libraries like
&lt;a href=&quot;https://www.unidata.ucar.edu/software/udunits/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;udunits2&lt;/code&gt;&lt;/a&gt;,
&lt;a href=&quot;https://gdal.org/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gdal&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://libgeos.org/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geos&lt;/code&gt;&lt;/a&gt; and
&lt;a href=&quot;https://proj.org/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;proj&lt;/code&gt;&lt;/a&gt; as well as having C++ components that need to be
compiled.&lt;/p&gt;

&lt;p&gt;We can use Conda to specifically create an environment into which we install
these libraries as well as install a specific version of R we want to use.
It’s important here that we use Conda to also manage our R installation, to
ensure that the right compiler tools are also added to our Conda environment in
order for the correct compiler toolchain to be used when compiling R packages
that use C++.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;One issue i’ve seen on ARC4 is people trying to mix using the anaconda module
and the R module. This always leads to problems because of the different
compiler toolchains that have been used.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So let’s get to business, and install this package on ARC4!&lt;/p&gt;

&lt;p&gt;To get started we need to get access to the Conda command line interface (CLI),
on ARC4 we have the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;anaconda&lt;/code&gt; module that provides access to this so lets load
it.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# add the anaconda module to get access to the conda CLI&lt;/span&gt;
module add anaconda/2022.05
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This means we can now use the command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda&lt;/code&gt; in the shell to create and manage
Conda environments.
Conda environments are very similar to virtual environments in Python; they
create an isolated environment into which we can install packages, helping
prevent the dependencies of one project conflict with the dependencies of
another.  &lt;a href=&quot;https://arctraining.github.io/hpc2-software/course/conda.html#conda-environments&quot;&gt;See more about Conda environments in our HPC2 course
notes&lt;/a&gt;.
When using Conda on our HPC systems it’s important to do our &lt;a href=&quot;https://arcdocs.leeds.ac.uk/software/compilers/anaconda.html#first-time-conda-setup&quot;&gt;suggested initial
configuration
steps&lt;/a&gt;
to ensure you don’t fill your home directory with Conda packages.&lt;/p&gt;

&lt;p&gt;For our example we want an environment into which we’re going to install R and
those library dependencies for our geospatial package
&lt;a href=&quot;https://cran.r-project.org/web/packages/terra/index.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terra&lt;/code&gt;&lt;/a&gt;.
Having a distinct environment for these dependencies helps isolate our project,
making sure that we keep the packages we need clearly specified and separated
from any other projects we might be doing that are using different packages.
This helps prevent package dependency conflicts, where two packages have a
dependency on the same package but require incompatible versions of the shared
package.&lt;/p&gt;

&lt;p&gt;To create an environment we use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda create&lt;/code&gt; command. In the snippet below
we specify the environment’s name, some packages we want to install with
specific versions and the &lt;a href=&quot;https://docs.conda.io/projects/conda/en/stable/user-guide/concepts/channels.html&quot;&gt;Conda
channel&lt;/a&gt;
from which we want to install these packages from.
It’s worth noting that the creation of Conda environments can take some time, as
it resovles all of our dependencies and fetches them from the Conda channel.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# create a conda environment called r-geo&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# and install 3 packages from the conda forge channel&lt;/span&gt;
conda create &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; r-geo &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; conda-forge r-base&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4.1.1 &lt;span class=&quot;nv&quot;&gt;gdal&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;3 udunits2 &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now this step above is sort of cheating. I only specify the geospatial library
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gdal&lt;/code&gt; here but Conda also installs an additional series of dependencies for
those libraries.
So I actually get a number of other critical geospatial libraries too such as
&lt;a href=&quot;https://proj.org/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;proj&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://libgeos.org/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geos&lt;/code&gt;&lt;/a&gt;.
This is an important caveat when using Conda, in that it doesn’t just install
the packages we ask for but also installs any dependencies the packages we
request depend on.
To be fully reproducible across different systems we need to be aware of this
and conscious of how we document these steps.
Conda provides a &lt;a href=&quot;https://arctraining.github.io/hpc2-software/course/conda.html#sharing-conda-environments&quot;&gt;number of commands for outputting a specification
file&lt;/a&gt;
for your environment that you can share and have others reproduce your
environment from. 
We &lt;strong&gt;strongly&lt;/strong&gt; recommend that if you’re using Conda you create these
environment specification files and include them in your project repositories to
help reproduce your environment. 
However that is a topic outside of the scope of this particular blog post so
lets now get back to installing
&lt;a href=&quot;https://cran.r-project.org/web/packages/terra/index.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terra&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With our environment created we now need to enter that environment with our shell. 
Conda environments are these isolated bubbles which we need to step into and out
of in the shell in order for that isolation to work.
To enter a Conda environment and have access to all the packages we’ve installed
in it we use the command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda activate ENV_NAME&lt;/code&gt;, where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ENV_NAME&lt;/code&gt; is the name
of the environment. 
However, on ARC4 we use the older version of this command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;source activate
ENV_NAME&lt;/code&gt; to avoid some niggles we have with the newer behaviour of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda
activate&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# activate the environment to use the packages you&apos;ve installed&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;source &lt;/span&gt;activate r-geo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;source activate&lt;/code&gt; our prompt will be prepended with the name of
our environment and we can now access the packages we installed into this
environment.
To install our R package we can either start up the R console and run
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;install.packages&lt;/code&gt; directly or use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;R -e&lt;/code&gt; command to pass in a string to the
R to be run without opening a full R console.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Install packages in R without starting an R console&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;r-geo&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; R &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;install.packages(&quot;terra&quot;, repo=&quot;https://cloud.r-project.org/&quot;);&apos;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will now attempt to install the package using the version of R we installed with Conda. 
This ensures that all the libraries we installed through Conda will be available
to R as it attempts to build any R packages that have C++ dependencies and uses
the same compiler toolchain that was used to compile the version of R we
installed with Conda.
Any packages installed within a Conda environment are also saved within the
Conda environment, helping isolate these R packages from any other R packages
you may have installed using an R module or in another Conda environment.
This again really helps with isolating our environment to prevent any package
conflicts that occur and also makes it easy to dispose of our environment when
we’re done with it (we just delete the Conda environment!).&lt;/p&gt;

&lt;p&gt;Overall, Conda is a very useful tool for managing dependencies and as
demonstrated here is not just for Python!
We can use it to manage versions of R, along with library dependencies for R
packages. 
This however does come with some potential drawbacks:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;We’ve added another tool; by using Conda to manage dependencies we’ve added to
the complexity of our project because for people to reproduce it they will now
need Conda.&lt;/li&gt;
  &lt;li&gt;We’re constrained by what libraries are available via Conda; now that we’re
using Conda to manage our library dependencies we’re dependent on someone
making sure those libraries are available and up-to-date via Conda. It also
becomes harder for us to compile a different library from source and make it
available to our Conda-installed version of R.&lt;/li&gt;
  &lt;li&gt;We’re using a different compiler toolchain than the one on our system; on ARC4
the R module has been compiled with a specific compiler available on the HPC.
When we use the Conda-installed version of R this has been compiled using a
different compiler toolchain (that is also installed via Conda). This may not
have optimised for the architecture of our HPC and so we might not be getting
the best performance for Conda-installed R versus the R module on HPC.  Whilst
out of scope of this blog post, you could have a go testing this by doing some
benchmarking of code comparing Conda-installed R and the HPC R module.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;spackapptainer-alternative&quot;&gt;Spack/Apptainer alternative&lt;/h2&gt;

&lt;p&gt;You could decide that you wanted to create a container with this package
included instead.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://spack.io/&quot;&gt;Spack&lt;/a&gt; is a package manager for supercomputers, that can
also help you build containers.  &lt;a href=&quot;https://apptainer.org/&quot;&gt;Apptainer&lt;/a&gt; is the
most widely used container system for HPCs.&lt;/p&gt;

&lt;p&gt;The Conda approach is definitely more straightforward, but there are
potentially performance advantages to the Spack route, with it using a
compressed image that takes up less space on disk, and also a single file,
which contrasts with the ~50k files likely with the Conda approach.  This is
particularly true if you’re using a Lustre filesystem (such as /nobackup), that
performs poorly with large numbers of files.&lt;/p&gt;

&lt;p&gt;It’s also easier to archive on OneDrive, to share with other people, or
transfer onto other systems.&lt;/p&gt;

&lt;h3 id=&quot;method&quot;&gt;Method&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Load the necessary anaconda (for Python) and apptainer modules&lt;/span&gt;
module add anaconda/2022.05 apptainer/1.1.6

&lt;span class=&quot;c&quot;&gt;# Write out a config file defining the container we want&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; spack.yaml &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;EOB&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;
spack:
  specs:
  - gdal@3
  - r@4.1.1
  - r-codetools
  - r-terra

  container:
    format: singularity
    images:
      os: &quot;ubuntu:22.04&quot;
      spack: develop
    os_packages:
      final:
      - libgomp1
      - libgfortran5
      - locales-all
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOB

&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;# Install a copy of Spack&lt;/span&gt;
git clone https://github.com/spack/spack
&lt;span class=&quot;c&quot;&gt;# Enable Spack&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; spack/share/spack/setup-env.sh 
&lt;span class=&quot;c&quot;&gt;# Generate a container definition file&lt;/span&gt;
spack containerize &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; r-geo.def
&lt;span class=&quot;c&quot;&gt;# Built it into a SIF file&lt;/span&gt;
apptainer build r-geo.sif r-geo.def

&lt;span class=&quot;c&quot;&gt;# You can delete the files we no longer need&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; spack r-geo.def spack.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This single file we’ve generated can now be used, e.g:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apptainer run r-geo.sif Rscript ./test.R
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I don’t think there’s a right or wrong answer to problems like this, and it’s
nice to have options.&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/conda-r-geospatial/</guid>
			</item>
		
			<item>
				<title>GitHub Codespaces for teaching</title>
				<link>https://arcleeds.github.io/blog/codespaces-teaching/</link>
				<pubDate>Wed, 05 Apr 2023 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;&lt;em&gt;Thumbnail taken from &lt;a href=&quot;https://github.blog/2021-08-11-githubs-engineering-team-moved-codespaces/&quot;&gt;GitHub blog post&lt;/a&gt;. All copyright for the image belongs to GitHub.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Recently, we delivered a Python and git/GitHub crash course session for a centre for doctoral training. It’s always great to do courses with a room full of keen PhD students and this was no exception. The catch with this course was the limited time frame required to both introduce Python and also git and GitHub. Our internal preference is to do this as two separate courses, a 2-day Python course and a 1-day intro to version control using git and GitHub.&lt;/p&gt;

&lt;p&gt;A critical steep learning curve for both these courses is often set up. We encourage people to bring their own devices or use a University cluster machine and typically try and use tools like conda to help manage installation. This however adds additional complexity which feels like an extra cognitive burden for learners. Now they have to think about environments, directories to install things, etc etc. In recent courses we’ve accepted this and spent some time talking about these things in the time we’ve had available but for a 1-day course touching on both we wanted to try something a little different. For this course setup need to be easy so we didn’t have to think about installing Python or git, and be able to get straight into writing Python with a bit of git thrown in as well as integrating with GitHub.&lt;/p&gt;

&lt;p&gt;The approach we went for was &lt;a href=&quot;https://github.com/features/codespaces&quot;&gt;GitHub Codespaces&lt;/a&gt;, a service offered by GitHub that allows you to spin up a containerised cloud runtime of a repository that you can develop code in as well as running it. With GitHub free tier you get 120 free core hours per month (&lt;a href=&quot;https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts&quot;&gt;see more about billing&lt;/a&gt;) that was more than enough for this training course.&lt;/p&gt;

&lt;p&gt;We created a &lt;a href=&quot;https://github.com/ARCTraining/teaching-python-codespace&quot;&gt;template repository&lt;/a&gt; for Python containing a &lt;a href=&quot;https://github.com/ARCTraining/teaching-python-codespace/blob/main/.devcontainer/devcontainer.json&quot;&gt;devcontainer.json&lt;/a&gt; file that included the Python base container image to ensure Python was installed from the get go. Forking from this template we created a &lt;a href=&quot;https://github.com/ARCTraining/dimen-python-2023&quot;&gt;repository&lt;/a&gt; that contained the data and instructions needed for the workshop and encouraged all attendees to get a GitHub account and fork the workshop-specific repository. Attendees could create a Codespace instance using their forked repository which billed against their free hours but ensured their setup was the same as the instructor.
I think we could also do this via &lt;a href=&quot;https://classroom.github.com/&quot;&gt;GitHub Classroom&lt;/a&gt; however at this stage with users from multiple different academic institutions going via this route was more straightforward.&lt;/p&gt;

&lt;p&gt;This enabled all attendees to get a working environment to do the course in with the same Python installation, with git installed and with the repository pre-configured to push to their GitHub fork. This felt like a big win for the crash course!&lt;/p&gt;

&lt;p&gt;There’s obviously pitfalls to this approach. Not actually exposing users to how to get all this set up hides some of the complexity and potentially makes it harder to translate this to different setup. But we made sure to sign post this clearly to attendees and provide resources to how they can set themselves up locally. I would argue with the time available this course is a fair compromise so we could get on with teaching Python and not fighting with different setups and configuring remotes with git.&lt;/p&gt;

&lt;p&gt;Our preference for teaching Python is to use a Jupyter notebook as the primary interface. This has its drawbacks but we accept these as instructors and try to reflect these during the session. GitHub codespaces  again makes this quite straightforward as VScode, the text editor codespaces is based on natively supports the Jupyter notebook format .ipynb. So, we can just create .ipynb files and specify that the kernel be the base Python installation and you can start to write notebooks. GitHub also supports (as a public beta) starting a codespace as a &lt;a href=&quot;https://github.blog/changelog/2022-11-09-using-codespaces-with-jupyterlab-public-beta/&quot;&gt;Jupyter Lab session direct from GitHub&lt;/a&gt;. This requires that the codespace has JupyterLab installed but again is a nice option to immediately drop people into a notebook like environment similar to &lt;a href=&quot;https://colab.research.google.com/&quot;&gt;Google Colab&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Overall, GitHub Codespaces worked really nicely for what we (the instructors) wanted here. We hope that attendees also found it straightforward (pending feedback) but would definitely consider using this in future for our training sessions and encourage others who are looking for easy to configure, small compute environments for teaching to explore this offering.&lt;/p&gt;

&lt;p&gt;If you’re interested in getting started with this I would recommend looking through the following resources:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;GitHub documentation on &lt;a href=&quot;https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/setting-up-your-python-project-for-codespaces&quot;&gt;setting up a Python Codespace&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers&quot;&gt;Introduction to dev containers&lt;/a&gt;, the underlying technology for Codespaces&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository&quot;&gt;GitHub Guide to creating a codespace on a repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/codespaces-teaching/</guid>
			</item>
		
			<item>
				<title>Opportunities with the Research Computing team</title>
				<link>https://arcleeds.github.io/blog/rse-at-leeds/</link>
				<pubDate>Wed, 05 Apr 2023 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;We’re very excited to announce we’re growing the Research Computing team here at Leeds!&lt;/p&gt;

&lt;p&gt;We’re growing the team over the next 12 months and adding more research software engineer roles to the team. 
Research software engineers are a crucial part of Research IT here at the University of Leeds, delivering computational training to researchers, providing research software engineering consulting for research projects, supporting the University’s high performance computing systems and developing our research computing community at the University. 
We’re currently a small, friendly team, and we come from a real variety of backgrounds including data scientists, web developers, and specialists in distributed graphics.
To give you a flavour of what the team is about and why you should apply check out these reasons below:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Work on diverse and interesting problems&lt;/strong&gt;, a core part of what we do is research software engineering consulting where academics come to us to ask for support on research projects. This means you get the opportunity to work on interesting and varied research problems, helping you develop new skills and overcome fascinating challenges.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Contribute to world-leading research&lt;/strong&gt;, the University of Leeds supports fantastic world-leading research and for many researchers software is at the heart of it. Being part of Research Computing gives you the opportunity to work directly with world-leading academics on their work but also contribute indirectly by providing training and guidance to researchers. This role is a fantastic opportunity to help contribute to, and accelerate work that can change the world.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;, in addition to flexibility in what you’ll get up to every day, our team also offers great flexibility in relation to working arrangements, supporting flexible hours and working from home. To ensure the team still feels connected we have regular stand up meetings and manage our tasks using GitHub projects helping foster remote collaboration.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Space to develop&lt;/strong&gt;, by offering the necessary support to the entire university, our team is constantly exposed to new concepts and tools. Therefore, personal development is not only supported, but encouraged and shared among us.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Work and learn with a team&lt;/strong&gt;, you will have the opportunity to work in an &lt;em&gt;Agile&lt;/em&gt; environment, using tools and methodologies that facilitate task management and a fair distribution of the workload.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/rse-at-leeds/</guid>
			</item>
		
			<item>
				<title>Spring 2023 Training Courses now open</title>
				<link>https://arcleeds.github.io/blog/Spring2023TrainingCourses/</link>
				<pubDate>Mon, 30 Jan 2023 00:00:00 +0000</pubDate>
				<description>&lt;p&gt;We’ve now confirmed some upcoming training courses which are now open for registrations!&lt;/p&gt;

&lt;p&gt;Whether you want to learn some Git, Linux command line or learn more about the University’s high performance computing systems we’ve got a course for you.&lt;/p&gt;

&lt;p&gt;Currently our courses are all still virtual workshops run online via Teams with course materials available online. They are hands-on so be prepared to do some typing!&lt;/p&gt;

&lt;p&gt;Find booking links on the course web pages below.&lt;/p&gt;

&lt;h2 id=&quot;february-2023&quot;&gt;February 2023&lt;/h2&gt;

&lt;h3 id=&quot;hpc0-introduction-to-linux-online&quot;&gt;HPC0: Introduction to Linux (Online)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 7th February 9.30am till 12.30pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a hands-on workshop intended as an introduction to the Linux command line and shell scripting. It is suitable for Linux, Unix and Mac OSX users. The purpose of the workshop is to give users the Linux skills to be able to handle data and files, run programs and automate workflows on a PC and on the HPC service. The content of this workshop is equally suited for people who wish to use command line Linux on a PC, in the Cloud or on a HPC platform. New and prospective HPC users are advised to take this workshop before taking the HPC1: Introduction to High Performance Computing at Leeds workshop.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc0/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;hpc1-hpc-carpentry&quot;&gt;HPC1: HPC Carpentry&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 14th February 9.30am-12.30pm&lt;/li&gt;
  &lt;li&gt;Tuesday 21st February 9.30am-12.30pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workshop is designed to introduce new users to the High Performance Computing (HPC) service at Leeds. It will be useful if you are new to HPC in research or have used HPC elsewhere. It is suitable for researchers from all faculties and examples will be given from a range of research domains. The purpose of the workshop is to give users the skills to be an effective user of the HPC service and to get codes and applications running effectively. This course is split over two sessions a week apart, &lt;strong&gt;please do not apply for this course unless you are able to attend ALL the sessions&lt;/strong&gt;.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc1/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h2 id=&quot;march-2023&quot;&gt;March 2023&lt;/h2&gt;

&lt;h3 id=&quot;swd2-version-control-with-git-and-github-in-person&quot;&gt;SWD2: Version Control with Git and GitHub (In person)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 7th March 10am-4pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Version control can be thought of as the lab notebook of the digital world: it’s what professional software developers and authors use to keep track of what they’ve done and to collaborate with other people. Every large software development project relies on it, and most programmers use it for their small jobs as well. It isn’t just for software: books, papers, small data sets, and anything that changes over time or needs to be shared can and should be stored in a version control system.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd2/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;There are limited spaces for these courses so if you are unable to book on you can still join the priority waiting list so you are contacted when we next run the training course.&lt;/p&gt;

&lt;h3 id=&quot;hpc0-introduction-to-linux-online-1&quot;&gt;HPC0: Introduction to Linux (Online)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 14th March 9.30am-12.30pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a hands-on workshop intended as an introduction to the Linux command line and shell scripting. It is suitable for Linux, Unix and Mac OSX users. The purpose of the workshop is to give users the Linux skills to be able to handle data and files, run programs and automate workflows on a PC and on the HPC service. The content of this workshop is equally suited for people who wish to use command line Linux on a PC, in the Cloud or on a HPC platform. New and prospective HPC users are advised to take this workshop before taking the HPC1: Introduction to High Performance Computing at Leeds workshop.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc0/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;hpc1-hpc-carpentry-1&quot;&gt;HPC1: HPC Carpentry&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 21st March 9.30am-12.30pm&lt;/li&gt;
  &lt;li&gt;Tuesday 28th March 9.30am-12.30pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workshop is designed to introduce new users to the High Performance Computing (HPC) service at Leeds. It will be useful if you are new to HPC in research or have used HPC elsewhere. It is suitable for researchers from all faculties and examples will be given from a range of research domains. The purpose of the workshop is to give users the skills to be an effective user of the HPC service and to get codes and applications running effectively. This course is split over two sessions a week apart, &lt;strong&gt;please do not apply for this course unless you are able to attend ALL the sessions&lt;/strong&gt;.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc1/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd1a-introduction-to-python-programming-in-person&quot;&gt;SWD1a: Introduction to Python programming (In person)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Wednesday 29th March 10am-4pm&lt;/li&gt;
  &lt;li&gt;Thursday 30th March 10am-4pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is an introduction to programming in Python for people with little or no previous programming experience. It uses plotting and visualising data as its motivating example based on an established research dataset. The course is suitable for attendees from all research domains and we will use a Web based programming environment (a Jupyter Notebook) which means you will be able to apply the ideas you learn on the course straightaway without having to install any software at home or at work. This course is running as 2 all day sessions delivered in person on campus. &lt;strong&gt;Please do not apply for this course unless you are able to attend ALL the sessions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At the end of the workshop, attendees will be able to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How to run Python programs&lt;/li&gt;
  &lt;li&gt;Storing data in computer programs (using variables and data types)&lt;/li&gt;
  &lt;li&gt;Using built in functions in programs&lt;/li&gt;
  &lt;li&gt;Avoiding and fixing errors in programs&lt;/li&gt;
  &lt;li&gt;Using software other people have written (libraries)&lt;/li&gt;
  &lt;li&gt;Reading tabular data and simple statistical analysis&lt;/li&gt;
  &lt;li&gt;Plotting data&lt;/li&gt;
  &lt;li&gt;Storing multiple values using lists&lt;/li&gt;
  &lt;li&gt;Repeating things using loops&lt;/li&gt;
  &lt;li&gt;Creating functions&lt;/li&gt;
  &lt;li&gt;Making programs do different things for different data (Conditionals: IF statements)&lt;/li&gt;
  &lt;li&gt;Writing simple tests: making sure our programs behave properly&lt;/li&gt;
  &lt;li&gt;Programming style&lt;/li&gt;
&lt;/ul&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd1a/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h2 id=&quot;april-2022&quot;&gt;April 2022&lt;/h2&gt;

&lt;h3 id=&quot;hpc0-introduction-to-linux-online-2&quot;&gt;HPC0: Introduction to Linux (Online)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Thursday 13th April 9.30am-12.30pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a hands-on workshop intended as an introduction to the Linux command line and shell scripting. It is suitable for Linux, Unix and Mac OSX users. The purpose of the workshop is to give users the Linux skills to be able to handle data and files, run programs and automate workflows on a PC and on the HPC service. The content of this workshop is equally suited for people who wish to use command line Linux on a PC, in the Cloud or on a HPC platform. New and prospective HPC users are advised to take this workshop before taking the HPC1: Introduction to High Performance Computing at Leeds workshop.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc0/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;hpc1-hpc-carpentry-2&quot;&gt;HPC1: HPC Carpentry&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tuesday 18th April 9.30am-12.30pm&lt;/li&gt;
  &lt;li&gt;Tuesday 25th April 9.30am-12.30pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workshop is designed to introduce new users to the High Performance Computing (HPC) service at Leeds. It will be useful if you are new to HPC in research or have used HPC elsewhere. It is suitable for researchers from all faculties and examples will be given from a range of research domains. The purpose of the workshop is to give users the skills to be an effective user of the HPC service and to get codes and applications running effectively. This course is split over two sessions a week apart, &lt;strong&gt;please do not apply for this course unless you are able to attend ALL the sessions&lt;/strong&gt;.&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/hpc1/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd1b-introduction-to-r-programming-in-person&quot;&gt;SWD1b: Introduction to R Programming (In person)&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Wednesday 19th April 10am till 4pm&lt;/li&gt;
  &lt;li&gt;Thursday 20th April 10am till 4pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This course is running as 2 all day sessions delivered in person on campus. &lt;strong&gt;Please do not apply for this course unless you are able to attend ALL the sessions.&lt;/strong&gt; This is an introduction to programming in R for people with little or no previous programming experience. It uses plotting and visualising data as its motivating example based on an established research dataset. The course is suitable for attendees from all research domains and we will use a Web based programming environment (RStudio cloud) which means you will be able to apply the ideas you learn on the course straightaway without having to install any software at home or at work.&lt;/p&gt;

&lt;p&gt;At the end of the workshop, attendees will be able to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How to run R programs&lt;/li&gt;
  &lt;li&gt;Storing data in computer programs (using variables and data types)&lt;/li&gt;
  &lt;li&gt;Using built in functions in programs&lt;/li&gt;
  &lt;li&gt;Avoiding and fixing errors in programs&lt;/li&gt;
  &lt;li&gt;Using software other people have written (packages)&lt;/li&gt;
  &lt;li&gt;Reading tabular data and simple statistical analysis&lt;/li&gt;
  &lt;li&gt;Plotting data&lt;/li&gt;
  &lt;li&gt;Storing multiple values using lists&lt;/li&gt;
  &lt;li&gt;Repeating things using loops&lt;/li&gt;
  &lt;li&gt;Creating functions&lt;/li&gt;
  &lt;li&gt;Making programs do different things for different data (Conditionals: IF statements)&lt;/li&gt;
  &lt;li&gt;Writing simple tests: making sure our programs behave properly&lt;/li&gt;
  &lt;li&gt;Programming style&lt;/li&gt;
&lt;/ul&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd1b/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;

&lt;h3 id=&quot;swd5-scientific-python&quot;&gt;SWD5: Scientific Python&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Wednesday 26th April 10am till 4pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workshop is aimed at people who want to learn how to use Python for Scientific Computing tasks. The workshop will give an introduction to Python’s main Scientific libraries (Scipy, Numpy and Matplotlib) and will also cover how to link existing C and Fortran codes and subroutines within your Python code. All exercises will use Python 3. This would be an ideal course to attend before ‘High Performance Python’.&lt;/p&gt;

&lt;p&gt;At the end of the workshop, attendees will be able to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A recap on Python data types&lt;/li&gt;
  &lt;li&gt;Numpy: arrays, matrices and linear algebra&lt;/li&gt;
  &lt;li&gt;Numpy: random numbers&lt;/li&gt;
  &lt;li&gt;Numpy: Fourier transforms and polynomials&lt;/li&gt;
  &lt;li&gt;Scipy: Linear Algebra and wrappers to LAPACK &amp;amp; BLAS&lt;/li&gt;
  &lt;li&gt;Scipy: Numerical Integration&lt;/li&gt;
  &lt;li&gt;Scipy: Interpolation&lt;/li&gt;
  &lt;li&gt;Scipy: Optimisation&lt;/li&gt;
  &lt;li&gt;Scipy: Special functions&lt;/li&gt;
  &lt;li&gt;Matplotlib: interactive and non-interactive plotting&lt;/li&gt;
  &lt;li&gt;Matplotlib: producing publication-quality figures&lt;/li&gt;
  &lt;li&gt;Matplotlib: creating diagrams&lt;/li&gt;
  &lt;li&gt;Interfacing to C and Fortran&lt;/li&gt;
&lt;/ul&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a style=&quot;color:#FFF;text-decoration:inherit;&quot; href=&quot;https://arc.leeds.ac.uk/training/courses/swd5/&quot; class=&quot;button&quot;&gt;Book now&lt;/a&gt;
&lt;/div&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/Spring2023TrainingCourses/</guid>
			</item>
		
			<item>
				<title>Adventures with WSL2/Spack/Apptainer</title>
				<link>https://arcleeds.github.io/blog/wsl2spackapptainer/</link>
				<pubDate>Mon, 16 Jan 2023 00:00:00 +0000</pubDate>
				<description>&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;This was meant as a deliberate tinker with these tools, to see what worked, and how unpleasant the process would be.  I’m not trying to claim this was the best way of acheiving what I was needing to do, but was meant to see whether we could get anywhere with building a piece of software under WSL2, and then carrying that over onto an HPC.&lt;/p&gt;

&lt;h2 id=&quot;approach&quot;&gt;Approach&lt;/h2&gt;

&lt;p&gt;The idea was to use WSL2 under Windows to get &lt;a href=&quot;https://espressomd.org/wordpress/&quot;&gt;ESPResSo&lt;/a&gt; working with &lt;a href=&quot;https://www.walberla.net/&quot;&gt;waLBerla&lt;/a&gt; integration. although I ended up a little off piste.&lt;/p&gt;

&lt;p&gt;Since there weren’t believed to be packages that offered this, we’d need to build stuff from source to get there.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/windows/wsl/install&quot;&gt;WSL2&lt;/a&gt; was used for the Linux environment under Windows, &lt;a href=&quot;https://spack.io/&quot;&gt;Spack&lt;/a&gt; was used to build software, and &lt;a href=&quot;https://apptainer.org/&quot;&gt;Apptainer&lt;/a&gt; was used to build a container at the end, that could be taken and used elsewhere, for example on an HPC system.&lt;/p&gt;

&lt;h2 id=&quot;steps&quot;&gt;Steps&lt;/h2&gt;

&lt;h3 id=&quot;setup-a-wsl2-instance&quot;&gt;Setup a WSL2 instance&lt;/h3&gt;

&lt;p&gt;I’m assuming you have WSL2 enabled on your system, so I’m not covering that step.  It might be as simple as running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wsl --install&lt;/code&gt; in a command prompt, but I promise nothing.&lt;/p&gt;

&lt;p&gt;I installed the default &lt;a href=&quot;https://apps.microsoft.com/store/detail/ubuntu/9PDXGNCFSCZV&quot;&gt;Ubuntu image from the Microsoft Store&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Creating a WSL instance using this is straighforward.  In a command prompt run:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wsl &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; Ubuntu
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Up pops a new terminal, which asks you to set a username and password, and then you’re up and running with a working WSL2 instance:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/wsl2spackapptainer/wsl2.png&quot; alt=&quot;WSL2 start up&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;install-spack&quot;&gt;Install Spack&lt;/h3&gt;

&lt;p&gt;Well, before we install Spack, we’re going to install some dependencies:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; build-essential gfortran
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is the essential bits that Spack’s likely to need - it includes compilers and GNU Make, and I’ve tacked on a Fortran compiler at the end as I know I’ll be needing that later.&lt;/p&gt;

&lt;p&gt;Installing Spack itself is just like on any other Linux system:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Get it from github&lt;/span&gt;
git clone https://github.com/spack/spack
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;spack
&lt;span class=&quot;c&quot;&gt;# Switch the the latest release version&lt;/span&gt;
git checkout v0.19.0
&lt;span class=&quot;c&quot;&gt;# Source the config file&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; share/spack/setup-env.sh 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That all works cleanly:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/wsl2spackapptainer/installspack.png&quot; alt=&quot;Install spack&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;check-espressomd&quot;&gt;Check espressomd&lt;/h3&gt;

&lt;p&gt;We can have a look at the package that exists for espressomd in Spack:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;spack list |grep &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; espresso
py-espresso
py-espressopp
quantum-espresso
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We have a few options there, and we can look at each one:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;spack info py-espresso
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This shows us it’s the one we want, but doesn’t mention anything about waLBerla, so it looks like we’ll have to sort this bit out ourselves.  You can also look at the full list of dependencies it expects to need using:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;spack spec py-espresso
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It’s never a bad thing to do an early check like this anyway, as it triggers Spack to install its necessary bootstrap packages, providing functionality needed by Spack itself.  But sadly, there’s no mention of waLBerla.&lt;/p&gt;

&lt;p&gt;There’s no point tweaking the py-espresso package to use waLBerla yet, given we don’t have waLBerla installed.&lt;/p&gt;

&lt;h3 id=&quot;install-walberla&quot;&gt;Install waLBerla&lt;/h3&gt;

&lt;p&gt;There isn’t a package for waLBerla, but it is a standard CMake package, so should be easy for Spack to handle.  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spack create&lt;/code&gt; is able to interrogate the source release, and use that to create a template build script:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;spack create https://i10git.cs.fau.de/walberla/walberla/-/archive/v6.1/walberla-v6.1.tar.bz2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;/images/blog/wsl2spackapptainer/initialrecipe.png&quot; alt=&quot;Basic recipe&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now this isn’t a perfect package file, as it doesn’t have any dependencies defined, but it’s a very nice starting point, given how little effort we’ve had to put in to make it.  Let’s give that a try and see what fails, if anything:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;spack &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;walberla
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This goes through and installs all the things it thinks it needs to build a generic CMake package, then fails:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Wrapper.h:68:10: fatal error: mpi.h: No such file or directory
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ah okay, it needs MPI to be installed. Edit the recipe (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spack edit walberla&lt;/code&gt;) so we can add a dependency on MPI where it says in the file:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;mpi&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;How did I know it was a package called “mpi” that I needed to add here?  I actually just did &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spack info hdf5&lt;/code&gt; to take a look at another package I knew probably had a similar requirement, and learnt from that.&lt;/p&gt;

&lt;p&gt;Retry the install (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spack install walberla&lt;/code&gt;) and it fails again, this time with a new error:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;987     g++: fatal error: Killed signal terminated program cc1plus
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What’s happened here is that we’ve run out of memory, since by default, WSL2 gets no more than 50%/8Gbytes of RAM, and 2Gbytes of swap.  To increase this, create a file in your Windows home directory (e.g &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;C:\Users\exuser&lt;/code&gt;) called .wslconfig containing:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;wsl2]
&lt;span class=&quot;c&quot;&gt;# Limits VM memory to use no more than 12 GB, defaults to 50% of ram&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;memory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;12GB
&lt;span class=&quot;c&quot;&gt;# Sets the amount of swap storage space to 16GB, default is 25% of available RAM&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;swap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;16GB
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In my case, this is just enough to let it build successfully, but you may want different figures for your system.  It appears to need a total of ~15Gbytes to run all in memory, but that wasn’t an option on the 16Gbyte machine I tested on.  Pick figures that work for you.&lt;/p&gt;

&lt;p&gt;You need to restart wsl at this point, so in a Windows command prompt:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wsl &lt;span class=&quot;nt&quot;&gt;--shutdown&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Start your Ubuntu session back up (I just clicked the Ubuntu entry in the Start Menu), reload spack into your environment, and build waLBerla again:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; spack/share/spack/setup-env.sh
spack &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;walberla
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Spack will only rebuild what it needs to, so it should skip straight to building waLBerla, and this time it will succeed.&lt;/p&gt;

&lt;h3 id=&quot;why-im-off-piste&quot;&gt;Why I’m off piste…&lt;/h3&gt;

&lt;p&gt;This is the point I realise that what I thought I understood about how espressomd integrated with waLBerla was total nonsense, and I’d been digging an interesting shaped hole all this time.  The integration isn’t present in the main fork, and when it is included, it pulls in its own copy of waLBerla rather than using an existing build version!  Ah well, at least we know we’ve got all the pieces in places for this to work…&lt;/p&gt;

&lt;h3 id=&quot;actually-installing-py-espresso-with-walberla-support&quot;&gt;Actually installing py-espresso with waLBerla support&lt;/h3&gt;

&lt;p&gt;We’re going to create a new package py-espresso-walberla, and create a config based on py-espresso, but with the other git repo, and targeting the branch we want to build.  This is similar to what we did before with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spack create&lt;/code&gt; but here’s we’re giving it a name explicitly, and making sure that it understands that it’s a project that builds via CMake.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;spack create &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; py-espresso-walberla https://github.com/RudolfWeeber/espresso &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; cmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This config is wrong, but if I copy the text out of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spack edit py-espresso&lt;/code&gt; and edit it to fix the class name, git repo, and branch, we end up with:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
&lt;/span&gt;

&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;spack.package&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;spack.pkg.builtin.boost&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Boost&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;PyEspressoWalberla&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CMakePackage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;ESPResSo is a highly versatile software package for performing and
    analyzing scientific Molecular Dynamics many-particle simulations of
    coarse-grained atomistic or bead-spring models as they are used in
    soft matter research in physics, chemistry and molecular biology. It
    can be used to simulate systems such as polymers, liquid crystals,
    colloids, polyelectrolytes, ferrofluids and biological systems, for
    example DNA and lipid membranes. It also has a DPD and lattice
    Boltzmann solver for hydrodynamic interactions, and allows several
    particle couplings to the LB fluid.
    &quot;&quot;&quot;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;homepage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;https://espressomd.org/&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;https://github.com/RudolfWeeber/espresso&quot;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;walberla&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;walberla&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;cmake@3.0:&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;build&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;mpi&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;boost+serialization+filesystem+system+python+mpi&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# TODO: replace this with an explicit list of components of Boost,
&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;# for instance depends_on(&apos;boost +filesystem&apos;)
&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;# See https://github.com/spack/spack/pull/22303 for reference
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Boost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;with_default_variants&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;python&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;py-cython@0.23:&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;build&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;py-numpy&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;build&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;run&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fftw&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;hdf5+hl+mpi&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That includes everything but turning on the waLBerla support, so we add in:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;n&quot;&gt;variant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;walberla&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Include waLBerla support&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;cmake_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;spec&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;spec&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
            &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;define_from_variant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;ESPRESSO_BUILD_WITH_WALBERLA&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;walberla&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Have we arrived at working build?  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spack install py-espresso-walberla&lt;/code&gt; rather does make it look like we have.&lt;/p&gt;

&lt;p&gt;Now was that really the right way to add this new version of py-espresso?  I’m not going to lose sleep over it right now.&lt;/p&gt;

&lt;h2 id=&quot;putting-this-in-a-container&quot;&gt;Putting this in a container&lt;/h2&gt;

&lt;p&gt;What if I wanted to export this as a container to run on another system?  This is where I think we can plug Apptainer and Spack together.&lt;/p&gt;

&lt;h3 id=&quot;a-basic-spack-container-recipe&quot;&gt;A basic Spack container recipe&lt;/h3&gt;

&lt;p&gt;Spack has support for making Apptainer compatible recipes for exporting Spack environments into containers, but it’s not quite up to the challenge of working with this modified Spack (that exists on this machine alone).&lt;/p&gt;

&lt;p&gt;So let’s do the nearly-but-not quite, then tweak it.  If we write a spack.yaml file:&lt;/p&gt;
&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;spack&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;specs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;py-espresso-walberla&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;container&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;singularity&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;images&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ubuntu:22.04&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;spack&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;develop&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here we create a file for Spack asking for our software (py-espresso-walberla) to be installed, making a recipe suitable to be built with Singularity (which is compatible with Apptainer), and to use ubuntu:22.04 as the base distribution for the build (since we might as well try matching the version we’ve already tested with in WSL2).&lt;/p&gt;

&lt;p&gt;We can then ask spack to generate a recipe to be used by Apptainer to make this container:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;spack containerize &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; py-espresso-walberla.def
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here it would probably help you to understand what the Spack created container recipe tries to do.&lt;/p&gt;

&lt;p&gt;The idea here is that Spack generates a recipe to build you a container with the software you’ve asked for inside.  But to do that, it pulls down a Docker container from a container registry (e.g. Docker Hub), which comes preconfigured with a working Spack.  This causes us some bother here, because we don’t want the stock version, we want to use a modified version that contains our changes.  In theory there’s a way of telling it to pull a custom version from a git repository, but I had a look at this and it appears to not work properly when building a Singularity container, and only works if you’re building a Docker container, which I don’t want to do.  The fix we apply here is to use the default Docker container to build our new container, but before using it, we delete the Spack install they’ve put on, and copy in the one we’ve just tested.  It’s a bit messy, but it’ll do.&lt;/p&gt;

&lt;p&gt;Additional tweaks to py-espresso-walberla.def:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;%files
spack /opt/newspack

&lt;span class=&quot;c&quot;&gt;# This is the top of the %post section, not an additional one&lt;/span&gt;
%post
   &lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; /opt/spack ~/.spack
   &lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; /opt/newspack /opt/spack
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We’re all setup at this point to try to make a container image, but don’t have the necessary software to do so.  So next we need to install Apptainer into our WSL2 instance, along with the required dependencies:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; uidmap squashfuse fuse2fs fuse-overlayfs gfortran
spack &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;apptainer@1.1.5~suid
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then use it to build the container:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;spack load apptainer
apptainer build &lt;span class=&quot;nt&quot;&gt;-B&lt;/span&gt; /run py-espresso-walberla.sif py-espresso-walberla.def
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There’s a couple of gotchas in there that I seem to have magically sidestepped with awesome foresight.  Ahem.  Make sure you don’t use the default OS image, else the compiler used is too old, and we’ve not done anything to load a newer compiler.  Also, if you get a cryptic permission denied error, that’s what the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-B /run&lt;/code&gt; avoids and you might end up spending far too long scratching you head why it’s complaining.  Apptainer is assuming that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/shm&lt;/code&gt; is a writable ramdisk, yet in the host environment we’re using, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/shm&lt;/code&gt; is actually a symbolic link to somewhere else inside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/run&lt;/code&gt;, so without this extra bind mount, which makes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/run&lt;/code&gt; outside the container visible as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/run&lt;/code&gt; within the container, Spack within the build container is unable to write to the ramdisk as it’s expecting to be able to.&lt;/p&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;

&lt;p&gt;We finish a very long and loopy process with a SIF file containing our custom build of py-espresso with waLBerla integration, along with all its dependencies, that we can now take onto other systems.  But we did at least get there, and have poked at the edges of what WSL2, Spack, and Apptainer can do, which might just come in useful with future projects.&lt;/p&gt;
</description>
				<guid isPermaLink="true">https://arcleeds.github.io/blog/wsl2spackapptainer/</guid>
			</item>
		
	</channel>
</rss>
