Using Modules
To run jobs on MOGON, you need to set up your environment correctly.
Environment Modules are a toolset that allows you to dynamically modify your shell environment to access various software packages and versions without polluting the global namespace. It provides you a way to manage multiple, conflicting software installations on a single system.
So, loading a particular module will set up an environment. This is mainly accomplished by exporting
environment variables,
particularly PATH
and (LD)_LIBRARY_PATH
and others. Usually modulefiles contain code to sanitize the setup, e.g. reporting conflicts with other loaded modules or deprecation warnings.
Lmod Environment Modules
Lmod (Lua-based Module System) is a widely used implementation of the Environment Modules system. It’s written in Lua and provides an efficient and flexible way to manage modules. Lmod is designed to be fast, scalable, and easy to use, making it a popular choice for HPC environments.
Frequently Used Commands
Lmod allows you to load, unload, and switch between different software packages and versions.
Command | Description | Example |
---|---|---|
module help | get a list of all commands known to module | |
module avail | find out what modules are available | module avail blender |
module list | list loaded modules | |
module load/add | loads modules/packages | |
module unload | unloads modules/packages | |
module swap | change from one compiler to another | module swap gcc intel |
module reset | go back to an initial set of modules |
Finding Modules
In many cases there are several versions of the same compiler/program installed. You have to check that your desired version is available.
module avail
You can get an overview of all available modules using the command
or
You can use the search capabilities to refine your search, e.g.:
gives
Area Specific Modules
EasyBuild, our software installation framework, provides prefixes – at least the way we install software – for modulefiles: bio
, chem
and phys
. This classification is a bit arbitrary at times, but you can search for the respective strings and look whether your desired application is already available.
Other classes include lib
and compiler
. Of particular relevance is sometimes the lang
category, e.g. for providing scripting languages with their correct version (see for example the entries on Python, R and BioConductor and Perl).
For example with
you get all the Modules in phys
:
module spider
The command module spider
lists all modules that can be loaded on MOGON.
gives
Loading Modules
Now, knowing the modules that are available, you can go on by loading the module(s) you need. This will happen using the command module load [module]
or module add [module]
.
Example: Maybe you want to load gcc (version 10.2.0) and OpenMPI, so you would do
That’s all - OpenMPI (version 4.0.5) was compiled with gcc 10.2.0 as the version string indicates, but mpicc depends on the specific compiler (and libraries), hence gcc is also provided in the correct version.
Listing active Modules
From the example above:
Unload Modules
To expel a specific module you can use the command
or
If you want to unload all your loaded modules, use
Displaying contents of a Module
User Collections
User defined initial list of login modules
On MOGON, users can create as many collections as they like. You can save to a named collection with:
The collection is restored with:
You can display the contents of a name collection with
Use the following command to list the collections you already have:
Finally, you can deactivate a collection with:
If no <collection_name>
is specified, the default is disabled. Note that the collection is not removed, only renamed. If you disable the collection foo
, the file foo
is renamed to foo~
. To restore the foo collection, you must do the following:
ml - A convenient Tool
For those of you who can’t type the mdoule, moduel, err module command correctly, Lmod has a tool for you. With
ml
you won’t have to type the module command again. The two most common commands aremodule list
andmodule load <something>
andml
does both:
— Lmod Documentation
means module list
. And
means module load foo
.
means module unload bar
. It is not surprising that these can be combined:
means module unload bar
; module load foo
.
You can do all the module commands: