Software Environment with Module
Overview
- More and more software at DESY is configured through the use of the module command. This allows loading and unloading different software packages (modules) on the fly, automatically making all of the necessary changes to your shell environment (variables for library and binary search paths, etc.). For example, you can choose between different versions of the same software package, or between different builds of the same library compiled with different compilers, etc.
Caveats
Extending $PATH and $LD_LIBRARY_PATH to locations on non-local storage can have adverse effects on your user experience (delays, hangs). It is therefore not recommended to execute module commands in your dot files. Instead, they should only be used in the shell instance where they are actually required.
Commands
Command |
Comments |
module --help |
|
module avail |
to list all available modules you can load |
module list |
to list your currently loaded modules |
module load moduleName |
to load moduleName into your environment |
module unload moduleName |
to unload moduleName from your environment |
module switch oldmoduleName newmoduleName |
first unloads module oldmoduleName then loads module newmoduleName |
module display moduleName |
lists the environment variables set up by the module moduleName |
module whatis moduleName |
more information about the software package moduleName |
module whatis |
list of available modules, with brief description |
Examples
- on SL6 available:
module avail ------------------------------------- /usr/share/Modules/modulefiles ------------------------------------- dot module-cvs module-info modules null use.own -------------------------------------------- /etc/modulefiles -------------------------------------------- intel.2011 maple.15 matlab/R2012a openmpi-x86_64 texlive/2011 maple/16 math.7 matlab.R2011a openmpi-x86_64-intel texlive/2012 maple.14 math.8 openmpi-i386 pgi.2011
- on SL6 available maple versions
module avail maple/ -------------------------------------------- /etc/modulefiles -------------------------------------------- maple/16 maple.14 maple.15
- load maple, list the loaded packages and show information about maple
module load maple
module list Currently Loaded Modulefiles: 1) maple/16
module display maple ------------------------------------------------------------------- /etc/modulefiles/maple/16: module-whatis Setup Maple version 16 prepend-path PATH /opt/maple/16/bin -------------------------------------------------------------------
module vs. ini
Environment modules are replacing ini. The former are widely used in scientific computing, while ini is practically unheard of outside DESY even though it's not necessarily inferior. There is a rough correspondence between ini and module commands:
ini command |
module command |
purpose |
ini |
module whatis |
list available modules, with brief description |
ini |
module avail |
list all available modules you can load |
ini |
module list |
list your currently loaded modules |
ini something |
module load something |
load something into your environment |
ini -something |
module unload something |
unload something from your environment |
- |
module switch oldmoduleName newmoduleName |
first unloads module oldmoduleName then loads module newmoduleName |
- |
module display moduleName |
lists the environment variables set up by the module moduleName |
Remarks
At the beginning of using modules, we hadn't pushed a whatis file, which makes the output of module whatis incomplete. This is being corrected as we roll out updated software packages.
The different versions of a product have to follow the naming convention <product>/<version>. This, too, is being corrected as we roll out updated software packages.
- If there are several versions of a module, the latest (in lexical order) is used automatically unless specified otherwise.