/
Using Modules: Considerations and Defaults

Using Modules: Considerations and Defaults

Goal: Highlight the modules have defaults, and good practices such as purging and defining module versions.


Defaults: Why Consider?

Modules change and are updated.

The defaults will change and update – you might not realize.

Please define the version of a module you’re using.

Helps to replicate and triage.


What are the Defaults?

Performing a module avail, anything with a (D) will indicate it will act as the default. Anything labelled with a (L) indicates it is already loaded.

[]$ module avail ... --------------- /apps/s/lmod/mf/opt/linux-rhel9-x86_64/compilers --------------- gcc/13.2.0 gcc/14.2.0 (D) nvhpc-sdk/24.3 oneapi/2024.1.0 []$ module load gcc/14.2.0 []$ module avail ... [salexan5@mblog2 ~]$ module load gcc/14.2.0 [salexan5@mblog2 ~]$ module avail ... ------------- /apps/s/lmod/mf/spack/linux-rhel9-x86_64/gcc/14.2.0 -------------- ... boost/1.83.0__filesystem_False boost/1.83.0__filesystem_True (D) ... flex/2.6.3 flex/2.6.4 (D) ... gmp/6.2.1_x86_64 (L) ... --------------- /apps/s/lmod/mf/opt/linux-rhel9-x86_64/compilers --------------- gcc/13.2.0 gcc/14.2.0 (L,D) nvhpc-sdk/24.3 oneapi/2024.1.0 ...

Good Practice: Module Purging

Over the course of a session, over many hours, you might be loading a number of different modules/software, you might be trying to install Python/R packages, you might be compiling source code…

We’d suggest when you switch context to a different application to perform a module purge and only load what is explicitly required.

This will avoid dependency hell.


Why do versions matter?

Consider Python Packages installed using pip:

  • You install a package with respect to the version of python you are using.

  • A packages is not automatically available/installed across different versions.

  • If you start using python/3.9 and then swap to python/3.10 you will need to re-install any packages.

# Example: [lib]$ pwd /home/<username>/.local/lib []$ ls python2.7 python3.9 python3.10 python3.12 # These folders will only be created if you use that version. # Each child folder has its own site-packages folder.

It is the same concept for R libraries.

This is covered in more detail under the following workshops:


Can I Automatically Load Modules at the Start of a Session?

If you are comfortable with using Linux, and understand what the .bashrc file does, then you can add module load commands to this file.

These will then automatically be loaded at the start of every session.

[~] vim .bashrc ... module load gcc/14.2.0 r/4.4.0 ...

Next time you start a new session:

[~] ml Currently Loaded Modules: 1) slurm/latest (S) 42) libxau/1.0.8 ... 41) xproto/7.0.31 ...

Since you have modified your .bashrc file, you need to remember you’ve done this, and be conscious of potential dependency issues if/when you load additional modules.


Updates to Modules

Typically ARCC will not remove a module.

We add/update modules, so new versions of a module become available, and previous ones remain, allowing reproducibility.

  • Some times a module does have to be removed due to a security vulnerability, for example previously we had an R Vulnerability and had to remove all versions prior to r/4.4.0.

  • We understand this is a inconvenience, but the security of the cluster and our users is paramount.


 

 

Related content