Using Environment Modules on HPC Clusters¶
Environment Modules is a package that allows you to dynamically modify a Linux user's environment through the use of modulefiles. These files contain information needed to configure the environment, making software packages accessible on demand. They are especially helpful in managing different versions of software packages.
This guide will help you understand the basics of using Environment Modules on our HPC clusters, including how to load, unload, and search for modules.
Introduction to Environment Modules¶
On HPC systems like OGBON, Environment Modules are used to modify the Linux environment variables, such as PATH, MANPATH, and LD_LIBRARY_PATH. These variables help the system locate and configure software packages.
Modules can be loaded and unloaded dynamically to manage multiple versions of software packages or associate them with specific versions of compilers or libraries.
Basic Commands¶
Checking Available Modules¶
To see a list of available modules, run:
Loading a Module¶
To load a module, use the following command:
Unloading a Module¶
To unload a module, enter:
Unloading All Modules¶
To unload all modules at once, run:
Listing Loaded Modules¶
To see a list of currently loaded modules, use:
Working with Modules¶
In this section, you'll learn how to find, load, and unload modules.
Warning
Avoid loading Python or R modules simultaneously with conda environments. This will almost always break something.
Find Modules¶
Listing All Available Modules¶
To list all available modules, run:
Searching for Modules¶
To search for specific modules or extensions, use avail. For example, to find and list all Python version 3 modules, run:
Getting Module Help¶
To access a brief description of a module, enter:
If you can't find a required software package, contact us with a software installation request or consult our installation guides to install it yourself.
Loading and Unloading Modules¶
Loading Modules¶
To load a module and its dependencies, use the module load command. For batch jobs, add the module load command(s) to your submission script.
For example, to load CMake version 3.22.1 and GCC version 11.2.0, run:
To see the loaded modules, run module list.
Unloading Modules¶
To unload a specific module that you've previously loaded:
Or unload all modules at once with:
Further Reading¶
For more information on using Environment Modules, consult the documentation on the cluster by running:
Note
Be cautious when loading Python or R modules simultaneously with conda environments, as this may cause conflicts.
Best Practices and Troubleshooting¶
Here are some best practices and troubleshooting tips to help you effectively work with Environment Modules:
-
Always use the appropriate version of a module, as different versions may have different dependencies and features.
-
Make sure to unload conflicting modules before loading new ones. For example, unload an older version of a compiler before loading a newer one.
-
If you encounter issues when loading a module, check the module's help documentation using
module help <module name>for guidance on proper usage. -
In case of errors or conflicts, unload all modules using
module purgeand start again by loading the necessary modules in the correct order.