Environment Modules on H4H🔗
To prevent repeated installations of software commonly used across the cluster,
- The Environment Modules system is used to provide a standard set of precompiled programming languages, software tools and libraries accessible to all users on H4H.
- For many common tasks these modules will be sufficient to complete your analysis.
For cases where a software dependency is unavailable you have two courses of action:
- Contact the cluster administrators and request they install it
- Install the software locally in your H4H home directory (see Installing Packages)
Basic module
Commands🔗
The user interface for the Modules package is accessible via the module
command. In general, loading a module will modify environment variables
such as your PATH
or MANPATH
to provide access to the requested software.
To view an overview of available subcommands for module
, run module -t
.
Note that module
is generally only available during job execution and thus
cannot be loaded from the Login
or Data
nodes.
To view a short list of available subcommands, simply type module
into the terminal.
module avail
- Opens a list of all available modules using the
less
command, allowing you to browse the pages with arrow keys - You can pass a pattern string to the command to only show modules matching the pattern
- If you pass a specific module name (case sensitive), the utility will show you a list of available versions and a description of that module
module spider
- Similar to
avail
, but specifically lists all available versions - Also supports passing module names or patterns
module whatis
- Get the description text for a module using its name
module load
- Load the module into your current environment
- This works by modifying your
PATH
environment variable
module list
- Lists all loaded modules
- Accepts patterns, which can be useful if you have a lot of modules loaded
module unload
- Removes a loaded module from your current environment
Try it yourself🔗
-
Allocate an interactive so you have access to the module command
-
Use
module avail
ormodule spider
to find the module for the most recent R version available on the cluster -
Get a description of the most recent R module
-
Load the most recent R module, inspecting the
$PATH
variable before and after loading -
Get the version of R and confirm it matches the module you loaded
-
Unload the R module
Module Collections🔗
If your analysis requires many modules it can be tedious to load all of them in your scripts. To get around this, the module
system provides a mechanism to save the state of your currently loaded modules into a collection. This collection can then be restored from the collection file in your job script or interative session.
Try it yourself:
-
Allocate an interative job on the cluster, if you don't already have one
-
View the documentation for the
module
command and note the options for thesave
andrestore
sub-commands -
Use
module spider
to find the most recent versions of samtools and picard -
Load the samtools and picard modules from step 3.
-
Save your currently loaded packages to a collection called test_collection
-
Open the module help pages and find the command to view available collections
-
Open the module help pages and find the command to unload all modules and then run it
-
List loaded modules to confirm the command worked
-
Restore your module collection
-
List loaded modules again to confirm that your command worked
-
Use the
module
documentation to find the command to list the contents of a module collection then run it on test_collection -
Use the
module
documentation to find the command to delete a collection then remove test_collection and unload all packages
Customizing Defaults🔗
There are many options available to customize the default behavior of modules.
These can be by creating a .modulerc
file in your $HOME
directory.
Alternatively, there are a number of enviromental variables which can be set
to modify how module
commands and sub-commands behave. Please refer to the
Environment Modules documentation for more details.