Introduction to the module system

Objectives

  • Learn the basics of the module system which is used to access most of the software at the majority of the HPC centres in Sweden
  • Learn about some of the most used commands for the module system
  • Find existing modules

Most programs are accessed by first loading them as a ‘module’. Thus, knowing about modules is necessary for you to be able to access the majority of the installed software at a centre!

Modules are:

  • used to set up your environment (paths to executables, libraries, etc.) for using a particular (set of) software package(s)
  • a tool to help users manage their Unix/Linux shell environment, allowing groups of related environment-variable settings to be made or removed dynamically
  • allows having multiple versions of a program or package available by just loading the proper module
  • are installed in a hierarchial layout. This means that some modules are only available after loading a specific compiler and/or MPI version, etc.
    • that is, the modules have prerequisites that needs to be loaded before they can be loaded.
    • Whether or not modules have prerequisites vary by center. On Kebnekaise, modules generally has prerequisites!

Kebnekaise is using the Lmod module system. It is an environment module system that is Lua based.

It is also using the EasyBuild framework for building and installing software modules.

Important

  • Take care not to use any system-installed versions of gcc, python, etc. Always use the module instead, when available!
  • Always check if there is a module instead of just building the software/package yourself!
    • Remember to check with different capitalization!
    • If the center you are at have modules installed in a hierarchical fashion, like HPC2N you must use module spider to check if a software is installed, since module avail only lists what is available with what is currently loaded
  • If there is a software missing that you need, then ask if it can be installed.

Useful commands

This is a list of some of the most useful commands for the module system. In the list below, MODULE is used as a stand-in for any software module.

  • See which modules exists: module spider or ml spider
  • See which versions exist of a specific module: module spider MODULE or ml spider MODULE
  • See prerequisites and how to load a specfic version of a module: module spider MODULE/VERSION or ml spider MODULE/VERSION
  • List modules depending only on what is currently loaded: module avail or ml av
  • See which modules are currently loaded: module list or ml
  • Loading a module: module load MODULE or ml MODULE
  • Loading a specific version of a module: module load MODULE/VERSION or ml MODULE/VERSION
  • Unload a module: module unload MODULE or ml -MODULE
  • Get more information about the paths etc. of a module: ml show MODULE or module show MODULE
  • Get information about what is in a module: module help MODULE or ml help MODULE
  • Unload all modules except the ‘sticky’ modules: module purge or ml purge
  • Module collections to load/unload a bunch of modules: module save <collection> and module restore <collection>

Finding existing modules

Warning

This differs somewhat between centres. on Kebnekaise it is best to use module spider!

This is mainly to do with whether or not modules in general have prerequisite modules that needs loading before, or not.

  • module spider: when there are prerequisites for most modules
  • module avail: when there generally are no prereqiuisites. On Kebnekaise this can be used to see what can be loaded given what is currently loaded.

Hint

module spider can be written in short form as ml spider

Example - all software
b-an01 [~]$ module spider

--------------------------------------------------------------------------------------------------------------
The following is a list of the modules and extensions currently available:
--------------------------------------------------------------------------------------------------------------
  :  (E)

  ABRicate: ABRicate/1.0.0
    Mass screening of contigs for antimicrobial and virulence genes

  ABySS: ABySS/2.2.5
    Assembly By Short Sequences - a de novo, parallel, paired-end sequence assembler

  ACTC: ACTC/1.1
    ACTC converts independent triangles into triangle strips or fans.

  ADGofTest: ADGofTest/0.3 (E)

  AICcmodavg: AICcmodavg/2.3-0 (E), AICcmodavg/2.3-1 (E), ...

  ALDEx2: ALDEx2/1.20.0 (E), ALDEx2/1.26.0 (E), ALDEx2/1.28.1 (E), ...

  ALL: ALL/1.30.0 (E), ALL/1.36.0 (E), ALL/1.38.0 (E), ...

  AMAPVox: AMAPVox/0.12.0 (E), AMAPVox/1.0.0 (E), AMAPVox/1.0.1 (E), ...

  AMGX: AMGX/2.2.0-CUDA-11.3.1
    Distributed multigrid linear solver library on GPU

  AMOS: AMOS/3.1.0
    The AMOS consortium is committed to the development of open-source whole genome assembly software

  AMPtorch: AMPtorch/0.1
    AMPtorch is a PyTorch implementation of the Atomistic Machine-learning Package (AMP) code that seeks to provide users with improved performance and flexibility as compared to the original code. The implementation does so by benefiting from state-of-the-art machine learning methods and techniques to be optimized in conjunction with high-throughput supercomputers.

  ANCOMBC: ANCOMBC/1.6.4 (E), ANCOMBC/2.4.0 (E), ANCOMBC/2.6.0 (E)

...

Hint

You can check if a specific software module is installed by trying module spider <SOFTWARE>

Example, GROMACS:

b-an01 [~]$ module spider GROMACS

--------------------------------------------------------------------------------------------------------------------
  GROMACS:
--------------------------------------------------------------------------------------------------------------------
    Description:
      GROMACS is a versatile package to perform molecular dynamics, i.e. simulate the Newtonian equations of motion for systems with hundreds to millions of particles.

     Versions:
        GROMACS/3.3.3-cphmd-1.3
        GROMACS/3.3.3-cphmd-1.3-1lpernode
        GROMACS/3.3.3-cphmd-1.4
        GROMACS/4.0.7-ionstr
        GROMACS/5.1.4
        GROMACS/2016.x-drude-20180214-g3f7439a
        GROMACS/2016.x-drude-20220117-g78fe3d1e
        GROMACS/2016.x-drude-20220120-ge35ae4e2
        GROMACS/2016.4
        GROMACS/2018.8
        GROMACS/2019
        GROMACS/2019.4-PLUMED-2.5.4
        GROMACS/2021
        GROMACS/2022.4
        GROMACS/2023.1-CUDA-11.7.0
        GROMACS/2023.1
        GROMACS/2023.3-CUDA-12.1.1-PLUMED-2.9.0
        GROMACS/2024.1
        GROMACS/2024.3-CUDA-12.4.0
     Other possible modules matches:
        GROMACS-LS

--------------------------------------------------------------------------------------------------------------------
  To find other possible module matches execute:

      $ module -r spider '.*GROMACS.*'

--------------------------------------------------------------------------------------------------------------------
  For detailed information about a specific "GROMACS" package (including how to load the modules) use the module's full name.
  Note that names that have a trailing (E) are extensions provided by other modules.
  For example:

     $ module spider GROMACS/2024.3-CUDA-12.4.0
--------------------------------------------------------------------------------------------------------------------

NOTE: Beware that you may have to try with different capitalization to find the software!

Warning

If you do module avail you will not get a full list of software, only those are available to load with no other prerequisites than are currently loaded. This is however, a good way to find compiler toolchains (more about that later).

You can write module avail in short form as ml av.

Example, module avail

Here you only get what is available without loading anything else. Most modules have prerequisistes so this is not the way to find all modules!

b-an01 [~]$ module avail

------------------------------------------- /hpc2n/eb/modules/all/Core -------------------------------------------
  ATSAS/3.2.1-1_amd64                                binutils/2.34
  Advisor/2023.2.0                                   binutils/2.35
  BLAST/2.11.0-Linux_x86_64                          binutils/2.36.1
  Bison/3.0.4                                        binutils/2.37
  Bison/3.0.5                                        binutils/2.38
  Bison/3.3.2                                        binutils/2.39
  Bison/3.5.3                                        binutils/2.40
  Bison/3.7.1                                        binutils/2.42                  (D)
  Bison/3.7.6                                        biosoup/0.11.0
  Bison/3.8.2                              (D)       code-server/4.97.2
  CMake/3.18.4                                       cuDNN/8.0.4.30-CUDA-11.1.1
  COMSOL/5.4.0.225                                   cuDNN/8.2.1.32-CUDA-11.3.1
  COMSOL/5.6.0.401                                   cuDNN/8.2.2.26-CUDA-11.4.1
  COMSOL/6.0.0.354                         (D)       cuDNN/8.4.1.50-CUDA-11.7.0
  CUDA/8.0.61                                        cuDNN/8.9.2.26-CUDA-12.1.1
  CUDA/10.1.105                                      cuDNN/9.1.1.17-CUDA-12.4.0
  CUDA/10.1.243                                      cuDNN/9.2.0.82-CUDA-12.4.0
  CUDA/11.3.1                                        cuDNN/9.5.0.50-CUDA-12.6.0     (D)
  CUDA/11.4.1                                        cuSPARSELt/0.6.0.6-CUDA-12.1.1
  CUDA/11.5.0                                        cuTENSOR/1.2.2.5-CUDA-11.1.1
  CUDA/11.6.0                                        cuTENSOR/2.0.1.2-CUDA-12.1.1   (D)
  CUDA/11.7.0                                        ffnvcodec/11.1.5.2
  CUDA/12.0.0                                        ffnvcodec/12.0.16.0
  CUDA/12.1.1                                        ffnvcodec/12.1.14.0
  CUDA/12.4.0                                        ffnvcodec/12.2.72.0            (D)
  CUDA/12.5.0                                        flex/2.6.3
  CUDA/12.6.0                              (D)       flex/2.6.4                     (D)
  CUDAcore/11.0.2                                    foss/2019a
  CUDAcore/11.1.1                          (D)       foss/2019b
  Catch2/2.13.9                                      foss/2020a
  Cereal/1.3.2                                       foss/2020b
  CheckM-Database/2015_01_16                         foss/2021a
  ChimeraX/1.1                                       foss/2021b
...

Exercise

  1. Try listing the available modules. See what happens differently for module spider and module avail.
  2. Try checking for a specific software module to see if it is installed:
    • GROMACS
    • Python
    • OpenFOAM
    • R
  3. What happens if you change the capitalization when you search for a module? Do you still find it?

Hint

The exercises for this section can also be found in the directory exercises/08.access-software/1.module-system that you got from the tarball.

Summary

Note

  • We learned about some of the most useful commands
  • We saw how to find which modules are available
    • Using module spider
    • Using module avail