LMOD (module command)
LMOD (Lua Modules) is a dynamic environment modules system used to manage environment variables for software applications and libraries. It simplifies the process of configuring the user environment by allowing users to load and unload modules that automatically set the required paths and environment variables.
Each module file defines the settings required for a specific application or software version, such as executable paths or library locations. Using LMOD allows users to switch between software versions and manage complex software environments without manually editing environment variables.
Searching for Available Modules
To search for software modules that match a keyword, use the module spider command.
module spider [keyword]Example:
module spider pythonThis command searches the module tree and displays modules related to the specified keyword.
Listing Available Modules
To display modules currently available to load, run:
module availThis command lists modules that can be loaded in your current environment.
Listing Loaded Modules
To display modules that are currently loaded in your environment, use:
module listThis command shows the modules and versions currently active in your session.
Loading a Module
To load a module and configure the environment for a specific application, use:
module load [module_name]Example:
module load intel/19.1.3.304Loading a module modifies environment variables such as PATH and LD_LIBRARY_PATH so the software can be used.
Unloading a Module
To remove a module from your environment, use:
module unload [module_name]Example:
module unload intel/19.1.3.304Unloading a module reverses any environment changes made when it was loaded.
Removing All Loaded Modules
To unload all currently loaded modules and return to a clean environment, run:
module purgeExample:
module purgeIt is not recommended to use module purge on LCC, as environment variables $SCRATCH, $PSCRATCH, and $PROJECT will be lost.
These variables are required for accessing storage resources.
Viewing Module Details
To display detailed information about a module, including the environment variables it modifies, run:
module show [module_name]Example:
module show intel/19.1.3.304This command displays the module file contents and environment changes that occur when the module is loaded.
Swapping Modules
To replace one module with another in a single command, use:
module swap [old_module] [new_module]Example:
module swap intel/18.0.3.222 intel/19.1.3.304This command unloads the first module and loads the second module.
Viewing Module Help
To display documentation or help information for a module, use:
module help [module_name]Example:
module help intel/19.1.3.304The help output typically includes information about how the software should be used and any important configuration details.
Summary
LMOD commands allow users to efficiently manage software environments on HPC systems by loading and unloading modules that configure the necessary environment variables. Using these commands helps maintain clean and reproducible software environments without manually modifying configuration files.