Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment management

Especially in HPC environments, the system is clogged with applications and libraries that cannot be all included at the same time into an environment path in a mantainable way. A way to include only a necessary portion of paths is via the lmod utility:

lmod (Environmental module system)

lmod provides a convenient way to dynamically change a user's environment through modulefiles.


A modulefile contains the necessary information to allow a user to run a particular application or provide access to a particular library. This includes easily adding or removing directories to the PATH environment variable.

  • Modulefiles for applications modify the user's path to make access easy.
  • Modulefiles for Library packages provide environment variables that specify where the library and header files can be found.

Usage

Check which modules are loaded into the system:

module list

Check which module are available to the system:

module avail

To get an overview of the environment modifications, run:

module show <module_name>

Adding modulefile

To write a custom loadable environment you can add a modulefile. These file must be present on MODULE_PATH following:

touch $MODULE_PATH/<modulefile_name>.lua

The content of the modulefile you state should look similar to:

help([[
For detailed instructions, go to:
   https://...

]])
whatis("Version: 5.0.1")
whatis("Keywords: System, Utility")
whatis("URL: http://content.allinea.com/downloads/userguide.pdf")
whatis("Description: Parallel, graphical, symbolic debugger")

setenv(       "DDTPATH",        "/opt/apps/ddt/5.0.1/bin")
prepend_path( "PATH",           "/opt/apps/ddt/5.0.1/bin")
prepend_path( "LD_LIBRARY_PATH","/opt/apps/ddt/5.0.1/lib")

Loadable with:

module load <modulefile_name>