Software module scheme
Since a HPC cluster is shared among many users, and also holds a significant size in contrast to most desktop compute machinery around, the amount of installed software spans many applications in many different versions and quite a few of them are installed typically non-standard places for easier maintenance (for admin crew), practical and security reasons. It is not possible (nor desirable) to use them all at the same time, since different versions of the same application may conflict with each other. Therefore, it is practical to provide the production environment for a given application outside of the application itself. This is done using a set of instructions and variable settings that are specific for the given application called an application module. This also simplifies control of which application versions are available in a specific session.
The main command for using this system is the module command. You can find a list of all its options by typing:
module --help
In NRIS we use the Lmod module system; for more info see https://lmod.readthedocs.io/en/latest/. The table below list the most commonly used options.
Command summary
Command |
Description |
|---|---|
|
List all software packages installed with a count of each module |
|
List all available modules and extensions |
|
List all available modules but showing extensions |
|
List all available modules, including hidden modules |
|
Search for a |
|
Load a |
|
List modules that are currently loaded |
|
Unload all loaded modules and reset modules to system default |
|
LReplace |
|
Show the commands in the |
|
Save the current list of modules to |
|
List all saved collections |
|
Restore modules from |
|
Prepend or append |
We are using self-contained modules in NRIS, meaning that a given module loads all dependecies necessary. It is recommended to module list after loading a set of modules to check that the correct environment is set up. It is also good practice to start all job scripts with a module reset before loading all necessary modules for the calculation. This will prevent including any loaded modules in the current login session.
Note
The module reset command will inform you that some modules (like StdEnv)
were not unloaded. Such modules are made “sticky” because they are necessary
for the system to work, and they should not be --force purged as the message
suggest. If this warning message annoys you, you can suppress it with the --quiet
option instead.
Some modules are mainly intended as dependencies for others, and are typically
not very useful by themselves. Such modules are made hidden to the module available
command to avoid cluttering the listed output. However, if you are compiling
your own code some of these might still be useful, and you can still load them.
To include hidden modules you can add the --show-hidden option to the module available search.
How to save and restore your module environment
When you have loaded all necessary modules for a particular purpose and made sure that your environment is working correctly, you can save it with
module save <name-of-env>
and later restore it with
module restore <name-of-env>
To list all your saved environments
module savelist
This feature is particularly convenient if you spend a lot of time compiling/debugging in interactive sessions. For production calculations using job scripts it is still recommended to load each module explicitly for clarity.