Software Modules

There is a wide range of software installed on the clusters, much of it available in multiple versions which might not be able to co-exist at any given time. To overcome this, the software installed on the cluster is available using a module based system called Lmod. This allows the user to customise which software, and which versions of that software, are available in their account.

For a quick guide to the software that is available on the clusters – click here.

Initial Account Setup

When an account is created, the only software available are the basic elements of Linux.

NOTE: The GCC compiler suite is available as a standard feature of Linux but if you are building your own software, please use one of the compilers available in the module system described below. Failure to do this may mean your software will not execute problem on the compute nodes.

Basic Usage

To get a list of modules currently available, use:

module avail

This will produce output looking like this:

----------------------------------------- /apps/modules/base -----------------------------------------
   ansys/2020r2    gcc/8.4.0         intel/2021.2  (D)    matlab/r2020a      python/3.8.5
   cmake/3.20.4    gcc/10.2.0 (D)    lsdyna/10.1.0        metashape/1.6.4    python/3.9.5 (D)

--------------------------------------- /apps/modules/default ----------------------------------------
   StdEnv (L)

------------------------------------- /opt/ohpc/pub/modulefiles --------------------------------------
   AnsysEM/16.2           FLUENT/17.2         autotools             papi/5.4.1
   AnsysST/17.2           FLUENT/18.2  (D)    clustershell/1.7.1    prun/1.0
   CFX/17.2               Matlab/2016a        giteye/2.2.0          qt/5.9.0
   CFX/18.2        (D)    Python/3.6.0        gnu/5.3.0             valgrind/3.10.1
   EasyBuild/2.5.0        Radioss/13.0        intel/16.0.3.210

  Where:
   D:  Default Module
   L:  Module is loaded

Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

This shows a list of the “base” modules that are available on the cluster.

Loading a Module

To make a module available in your account, simply use the command:

module load module_name

If you specify the full module name (including the version number), e.g. module load gcc/10.2.0, then that module will be loaded. If you just specify the module name (without the version number), e.g. module load gcc, then the default version of that module (the one with the (D) next to it) will be loaded. This is usually, but not always, the latest version of that module.

HINT: Deciding whether to specify a module version or not can be tricky. For most modules, not explicitly specifying the version is preferable as you then benefit automatically when any newer versions are installed.
However for software development, simply using a newer version of a module can create problems. This is particularly true when specifying compilers as an application compiled with an older compiler may experience problems when run using neweer versions of the same compiler.
To alleviate this, it is suggested that when loading compilers and various libraries (such as MPI), that explicit versions are specified. This allows you to upgrade to newer versions when you are ready.

Loading a Module (permanently)

Simple entering a module load command in a terminal window will load the module for that session only. The next time you log in, the module will not be loaded.

To overcome this, you need to edit a hidden file in your home directory called .bashrc. This file gets executed every time you log in so to make a module permanent simply add the module load command to the bottom of this file.

To learn how to edit a text file in Linux – click here.

Hierarchical Modules

Entering the module avail command initially shows you a list containing just the base modules. These are modules that have no dependencies on other modules.

The module system, however, allows a hierarchy of modules. For example, some software libraries (e.g. MPI) rely on the version of the compiler they were built with. This means that if there are 3 versions of compiler installed on the cluster, then there are 3 versions of the MPI library.

So, if you want to use MPI and version 10.2.0 of the GCC compilers then you will first need to module load gcc/10.2.0. You can then run module avail, and you will see a longer list which includes all the base modules (hreyed out below), plus the modules that depend on gcc/10.2.0.

-------------------------------- /lustre/software/modules/gcc-10.2.0 ---------------------------------
   boost/1.76.0      mvapich2/2.3.6  (D)    openmpi/4.0.4
   cgal/5.2.2        openblas/0.3.12        openmpi/4.1.1   (D)
   mvapich2/2.3.4    openblas/0.3.15 (D)    valgrind/3.17.0 (D)

----------------------------------------- /apps/modules/base -----------------------------------------
   ansys/2020r2    gcc/8.4.0           intel/2021.2  (D)    matlab/r2020a      python/3.8.5
   cmake/3.20.4    gcc/10.2.0 (L,D)    lsdyna/10.1.0        metashape/1.6.4    python/3.9.5 (D)

--------------------------------------- /apps/modules/default ----------------------------------------
   StdEnv (L)

------------------------------------- /opt/ohpc/pub/modulefiles --------------------------------------
   AnsysEM/16.2           FLUENT/17.2         autotools             papi/5.4.1
   AnsysST/17.2           FLUENT/18.2  (D)    clustershell/1.7.1    prun/1.0
   CFX/17.2               Matlab/2016a        giteye/2.2.0          qt/5.9.0
   CFX/18.2        (D)    Python/3.6.0        gnu/5.3.0             valgrind/3.10.1
   EasyBuild/2.5.0        Radioss/13.0        intel/16.0.3.210

  Where:
   D:  Default Module
   L:  Module is loaded

Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

You can then load the OpenMPI module by using module load openmpi/4.1.1.

Obviously, if you want to load both of these permanently, then you can add both module load commands to your .bashrc file.

Other useful module commands

As well as module avail and module load, there are a number of other useful commands:

module unload module_name
This unloads a module that you have previously loaded. This also unloads any module that depends on the module specified.

module list
This lists the modules that you have currently loaded.

module reset
This restores the set of loaded modules to the system defaults.

module help module_name
This displays the help message associated with that module which briefly describes how to use that module, including the extra commands that module makes available.