Scientific Computing and Data / High Performance Computing / Documentation / Software Environment: Lmod
Software Environment: Lmod
We have implemented the Lmod modules software package to manage nearly all software installed in Minerva and the associated user environment. Modules provide an easy mechanism for updating a user’s environment, especially the PATH, MANPATH, NLSPATH, and LD_LIBRARY_PATH environment variables, to name a few. The distinct advantage of the modules approach is that the user is no longer required to explicitly specify paths for different software versions nor need to try to keep the related environment variables coordinated. With the modules approach, users simply “load” and “unload” modules to control their environment.
Module Command
The “module avail” or “ml avail” command lists all the modules available on Minerva.
Another way to search for modules is with the “module spider” or “ml spider” command:
$ ml spider
This will show a compact listing of all available modules on the system.
The “module avail” and “module spider” commands have search capabilities:
$ ml avail lib
will list for any modulefile where the name contains the string “lib”.
To have a module loaded to your current environment:
$ module load modulefile [modulefile2]...
Alternatively, you can specify:
$ ml modulefile [modulefile2]...
To load a specific version of a package to your environment, load the module using its full name with the version explicitly specified, e.g,
$ ml python/2.7.16
Otherwise the default version will be loaded.
To remove a module from your current environment:
$ module unload modulefile or $ ml -modulefile
To remove all the modules from your current environment:
$ module purge or $ ml purge
The following command demonstrated the true advantage of using modules. Different versions of entire software packages can be replaced with a single module command:
$ module switch [modulefile_old] [modulefile_new]
Alternatively, you can simply load the new module:
$ module load modulefile_new or $ ml modulefile_new
This will replace the old version and the “module list” or “ml” command will list all the modules which are currently loaded in your environment.
Frequently used collection of modules can be saved using the ”module save” command so that they can be restored in your environment later using the “module restore” command:
To get more information about a specific module use the module help command to display the “help” information contained within the given module file.
The module show command allows you to see exactly what a given “modulefile” will do to your environment, such as what will be added to the PATH, MANPATH, etc. environment variables:
To get a usage list of module options type the “ml help” command.
Setting Up Your Own Modules
You can point the module command to your own modulefiles using the “module use” command. This command updates the environment variable MODULEPATH, which defines where modulefiles are to be found. Documentation on preparing modulefiles can be found online (but feel free to poke around our modulefiles for some examples. They live in /hpc/packages/minerva-XYZ/modulefiles, where XYZ is either centos7 or common.