Modules
In Metacentrum infrastructure all applications are packed into modules, which make sure that a given application will run within a correct environment (libraries, system variables etc.). Therefore to run a certain software, you must first load a module for this software.
To work with modules, you will need to use command module
(with options).
A complete guide to module
command can be found on https://modules.readthedocs.io/en/latest/modulefile.html. You can also browse the manpage (man module
).
On this page we will show only the most common usecases of the module
command.
Basic usecases
Search for modules
List all modules
List all modules starting by a certain string
List versions of a specific module
will get list of versions:
You can modify the search behaviour by e.g. options --indepth
or -a
. For all options, see man module
.
Load modules
Load a default version of a module
There is always a default version of a module (usually the newest, but can be also the most stable). If you have no specific reason to do otherwise, use the default version.
Load a specific version of a module
Unload modules
Unload a module
Clear all currently loaded modules
Warning
The module purge
command will remove also an automatically loaded module metabase/1
. This module makes accessible utils in /software/meta-utils/public
, like qextend
, clean_scratch
, walltime_prolong_user_info
, check-local-quota
and other commands. For this reason, we recommend to add module metabase/1
after using module purge
command.
Display info
List currently loaded modules
Display information about the module
Some important variables are
Specific usecases
Limit module span
Applications available through the module system automatically load all necessary dependencies, i.e. other modules. Loading many modules together may thus raise a conflict of loaded dependencies and the subsequent crash of some of the programs. When the user needs to use more modules in one job, it is advisable to limit the use of individual modules to only the necessary part of the script.
Within a single session you can use modules separately by enclosing them to parentheses. Parentheses, in general, create a subshell in bash, i.e. all modules loaded within a certain subshell will be unloaded automatically after the subshell exits.
In general
Example: conflicting python versions
Normally the following two modules will conflict if loaded within the same session:
However you can load them separately in subshells:
Modulefiles
A modulefile is a text file that collects paths to the binary, paths to external libraries and possible dependencies on other modules.
The modulefiles reside in some of the directories included in variable MODULEPATH
(echo $MODULEPATH
).
For many applications, there are several modules available. This means there are several copies of the software available, differing in version, compiler and other features. For example,
says there are 11 versions of TensorFlow software differing by version, Python version (2 or 3) and whether it can be used for GPU computing (gpu) or not (cpu).
Modulefile example
Notes:
- the number after the author’s name you can see in some modulefiles is the number of RT ticket which requested the installation
- the only necessary path is
PATH
, where the executable is - a modulefile can add other modules (
module add
…) if there is a dependency - basedir is path to the install directory - it can be pretty anywhere; in case of non-standard installation, e.g. to home directory, don’t forget to set variable
MODULEPATH
accordingly.
Last updated on